Here's a useful bit of transforming code that I keep looking up in several of my projects. Many thanks to Milan Negovan for the vast improvement over my initial code.
using System.Data;
using System.Xml;
DataSet ds = MethodReturnsDataSet();
XmlDocument xdoc = new XmlDocument();
xdoc.LoadXml(ds.GetXml());
Comments
Carl, why not xdoc.LoadXml (ds.GetXml ())?
Good Question! I suppose the answer is "I never saw GetXml()." I'll change the article text right away.
For the record, here's my initial bloated solution:
Thanks, Milan for that one. Now, it appears I need to do some refactoring...
Just remembered another one: XmlDataDocument. The class is a DataSet wrapper you treat as an XML document.