>Michel, do you actually *need* to have the schema included with your data? What are you doing with that data afterwards. If you can get by without using the schema (which, you should be able to, depending on what you're using it for), then all you need to do is return toDataSet.GetXml().
I made this method generic so it would fit VFP when using Web Service to receive the XML. But, on places where this is no needed, yes, what you wrote is probably much better to use.