There are essentially two parts to XML as it relates to ADO+ and the DataSet: Schema and Data.
<p>
<b>Schemas</b>
<br>Schemas, or the tables, columns, constraints and so forth, of a DataSet can be defined in severals ways. One method is to create them using properties and methods (PrimareyKey, Table.Add, Column.Add, and so on). This establishes a schema within your DataSet that can be used as a container to hold data. Another way is to use the SQLDataSetCommand or ADODataSetCommand. When you use these commands, if the schema does not exist in a DataSet, it is created for you (see: SchemaMappingAction for specifics about when to ignore, append or throw an exception on mismatched schemas). Essentially a DataSet can have either a dynamic or fixed schema through its lifetime.
<p>
XML is an intrinsic element of ADO+. Several methods that support XML have been implemented. The XMLSchema property is also used to work with schemas. This property allows you to set or get the schema of a DataSet using an XSD or XDR schema. (Note: you can only set XDR schemas; but the property always returns an XSD schema.) For example, if you load a DataSet from the database, you could get an XSD schema from it:
<p>
<div class=code>
Response.Write dsCustomersDataset.XmlSchema;
</div>
<p>
This return an XSD compliant XML schema for the schema in your DataSet. Conversly, setting this property returns a DataSet compliant with a given XSD schema.
<p>
<b>Data</b>
<p>
Data is also simply retrieved through the XmlData property. The XmlData property can set or get XML compliant data.
<p>
<div class=code>
Response.Write dsCustomersDataset.XmlData;
</div>
<p>
The sample below loads data from a database, and then outputs the XSD Schema and XML data. It also creates another DataSet using the same XML data.