# Import and Export

Learn about exporting and importing data to and from an XML document in Treeview.

## Content

TreeView supports both exporting and importing data to and from an XML document.

The <span data-popup-content="This class is available in C1TreeView classes of both \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET\u003c/a\u003e assemblies." data-popup-title="C1TreeView" data-popup-theme="ui-tooltip-green qtip-green">C1TreeView</span> class provides the [ReadXml](/componentone/docs/win/online-treeview/) method that allows you to load the treeView with the data of the XML document. The method accepts the XML file path as the parameter to determine the file from which the data is to be loaded.

In addition, the C1TreeView class provides the [WriteXml](/componentone/docs/win/online-treeview/) method that enables you to save the treeview contents to an XML document. Just like the ReadXml method, this method also accepts the file path as the parameter to determine the file to which the contents of the treeview are to be saved.

The following code snippet first imports data from an XML document (**Doc.XML**) to the TreeView control, and then exports data from the TreeView control to another XML document (**TreeView.XML**).

```vbnet
' call the ReadXml method
C1TreeView1.ReadXml("C:/Users/GPCTAdmin/Desktop/Doc.XML")
' call the WriteXml method
C1TreeView1.WriteXml("C:/Users/GPCTAdmin/Desktop/TreeView.XML")
```

```csharp
// call the ReadXml method
c1TreeView1.ReadXml("C:/Users/GPCTAdmin/Desktop/Doc.XML");
// call the WriteXml method
c1TreeView1.WriteXml("C:/Users/GPCTAdmin/Desktop/TreeView.XML");
```

>type=note
> **Note**: The latest WinForms .NET Edition does not include rich design-time support yet. We will enhance it in future releases.