I have been thinking about the optimal way to create an XML file using data from a Dataset AND according to the rules of an XML schema.
I’ve been searching around for a bit, and I failed to find a way in which I only take the data from the Dataset and put it inside a XML tags, with the tags being defined by an already-existing schema.
So it might go like this:
1- Create Dataset and fill its rows with data.
2- Create an XML according to an XML schema rules.
3- Fill said XML file with data from Dataset such that data is taken from the Dataset while structure of the XML file is taken from the XML schema.
Well. The easiest way to do this would be to use a strongly typed DataSet, if you only have one schema. You can also dynamically bind an XML schema to the schema of a DataSet. I think the only trick of it is that you need to have loaded the schema before the data. If that’s a problem, then create a secondary data set with the loaded schema and copy the data over.
Did I miss the point of your question entirely?