# Bind to XML

Binding to XML is not directly supported but DataTables are supported and a DataSet (containing DataTables) can be created from an XML document.

This is a simple xml file used in the examples below:

```XML
    <?xml version="1.0" encoding="utf-8"?>
    <people>
      <person>
        <name> John </name>
        <age> 30</age>
      </person>
      <person>
        <name> Sarah </name>
        <age> 45</age>
      </person>
      <person>
        <name> Tom</name>
        <age> 50 </age>
      </person>
    </people>
```

![WinForms RadGridView Bind to XML](https://www.telerik.com/products/winforms/documentation/assets/94f253ea09fdf4b3bde7331deedb1a0d/gridview-populating-with-data-bind-to-xml001.png)

You have to create a DataSet instance from the XML file. For the sample XML file above, the created DataSet contains only **one** DataTable which is set as RadGridView data source. Please refer to this [topic](https://www.telerik.com/products/winforms/documentation/controls/gridview/hierarchical-grid/creating-hierarchy-using-an-xml-data-source) if you want to create hierarchy.

```C#
DataSet xmlDataSet = new DataSet();
xmlDataSet.ReadXml("..\\..\\GridView\\PopulatingWithData\\gridXml.xml");
this.radGridView1.DataSource = xmlDataSet.Tables[0];
```

```VB.NET
Dim xmlDataSet As New DataSet()
xmlDataSet.ReadXml("..\\..\\GridView\\PopulatingWithData\\gridXml.xml")
Me.RadGridView1.DataSource = xmlDataSet.Tables(0)
```

## See Also

* [Bindable Types](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/bindable-types)

* [Binding to a Collection of Interfaces](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-a-collection-of-interfaces)

* [Binding to Array and ArrayList](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-array-and-arraylist)

* [Binding to BindingList](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-bindinglist)

* [Binding to DataReader](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-datareader)

* [Binding to EntityFramework using Database first approach](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-entityframework-using-database-first-approach)

* [Binding to Generic Lists](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-generic-lists)

* [Binding to ObservableCollection](https://www.telerik.com/products/winforms/documentation/controls/gridview/populating-with-data/binding-to-observablecollection)
