Gởi dữ liệu đến file xml.
1. Cú pháp file XML
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
   <xs:schema id="TenXML" xmlns=""  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="TABLEVIEW">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="TenCot" type="xs:string" minOccurs="0" />            
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
</NewDataSet>
 Giải thích:
TenXML: đặt tên bất kỳ (ko cấu cách, ko dấu)
TABLEVIEW: đặt tên bất kỳ (ko cấu cách, ko dấu)
<xs:element name="TenCot" type="xs:Kiểu" minOccurs="0" />          : mỗi dòng tương ứng 1 cột
TenCot: đặt tên bất kỳ (ko cấu cách, ko dấu)
Kiểu: 
   + string : kiểu chữ
   + int : kiểu số nguyên
   + double: kiểu số thập phân
   + date : kiểu ngày
 Ví dụ cấu trúc 1 file hồ sơ học sinh
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
   <xs:schema id="NewDataSet" xmlns=""  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="TABLEVIEW">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="_SYS_KEY" type="xs:string" minOccurs="0" />
                <xs:element name="HoTen" type="xs:string" minOccurs="0" />
                <xs:element name="DiaChi" type="xs:string" minOccurs="0" />
                <xs:element name="NgaySinh" type="xs:dateTime" minOccurs="0" />
                <xs:element name="DiemTrungBinh" type="xs:double" minOccurs="0" />           
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
</NewDataSet>
2. Các cột hệ thống mặc định
là các cột hệ thống tự lưu dữ liệu vào
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
   <xs:schema id="NewDataSet" xmlns=""   xmlns:xs="http://www.w3.org/2001/XMLSchema"   xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="TABLEVIEW">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="_SYS_KEY" type="xs:string" minOccurs="0" />             
                <xs:element name="_SYS_Create_Date" type="xs:dateTime" minOccurs="0" />
                <xs:element name="_SYS_Update_Date" type="xs:dateTime" minOccurs="0" />
                <xs:element name="_SYS_Create_User" type="xs:string" minOccurs="0" />
                <xs:element name="_SYS_Update_User" type="xs:string" minOccurs="0" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
</NewDataSet>
Giải thích:
_SYS_KEY: là mã khóa duy nhất tự sinh ra, ví dụ 7701b2f7-3cc7-43df-a76f-8665a096d8ef  
   cột này bắt buộc có
_SYS_Create_Date : ngày tạo bảng ghi , cột có thể có hay không
_SYS_Update_Date : ngày sửa bảng ghi, cột có thể có hay không
_SYS_Create_User : người tạo bảng ghi, cột có thể có hay không
_SYS_Update_User : người sửa bảng ghi, cột có thể có hay không
* bảng ghi: là 1 dòng thông tin
Ví dụ cấu trúc file xml có dữ liệu
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
   <xs:schema id="NewDataSet" xmlns=""   xmlns:xs="http://www.w3.org/2001/XMLSchema"   xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
      <xs:complexType>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element name="TABLEVIEW">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="_SYS_KEY" type="xs:string" minOccurs="0" />
                <xs:element name="HoTen" type="xs:string" minOccurs="0" />
                <xs:element name="DiaChi" type="xs:string" minOccurs="0" />
                <xs:element name="NgaySinh" type="xs:dateTime" minOccurs="0" />
                <xs:element name="DiemTrungBinh" type="xs:double" minOccurs="0" />           
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:choice>
      </xs:complexType>
    </xs:element>
  </xs:schema>
   <TABLEVIEW>
    <_SYS_KEY>7701b2f7-3cc7-43df-a76f-8665a096d8ef</_SYS_KEY>
    <HoTen>Tran Van A</HoTen>
   <DiaChi>Q1, HCM</DiaChi>
    <NgaySinh>2015-11-16T00:00:00+07:00</NgaySinh>
    <DiemTrungBinh>18</DiemTrungBinh>  
   </TABLEVIEW>
 <TABLEVIEW>
    <_SYS_KEY>2701b2f7-2cc7-43df-h76f-8665a396d8ef</_SYS_KEY>
    <HoTen>Tran Van B</HoTen>
   <DiaChi>Q1, Can Tho</DiaChi>
    <NgaySinh>2012-10-16T00:00:00+07:00</NgaySinh>
    <DiemTrungBinh>20</DiemTrungBinh>  
   </TABLEVIEW>
</NewDataSet>
* Phần trong TABLEVIEW là 1 dòng dữ liệu
Cách tạo file xml