# DataSourceManager.LoadXmlFile Method

> Loads the contents of an XML file as a data source.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.DocumentServer.DataSources`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDocumentServer.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.DataSources > DataSourceManager.LoadXmlFile Method
- **330 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlfile-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlfile-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlfile-method/llms-full.txt

---

### Description

Loads the contents of an XML file as a data source.

### Syntax

```csharp
public void LoadXmlFile(string fileName);
```

```vbnet
Public Sub LoadXmlFile(fileName As String)
```

### Parameters

| Parameter | Description |
|---|---|
| fileName | The file name. |

### Examples

The following example uses Load Xml File in a focused Data Source Manager workflow. The created object is then available to the surrounding document workflow.

```csharp
dataSourceManager.LoadXmlFile("document.docx");
Console.WriteLine("Data Source Manager is ready for use.");
```

```vbnet
dataSourceManager.LoadXmlFile("document.docx")
Console.WriteLine("Data Source Manager is ready for use.")
```

---

## Nearby

- **Previous:** [DataSourceManager.LoadSingleObject Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadsingleobject-method/llms-full.txt)
- **Next:** [DataSourceManager.LoadXmlString Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/datasourcemanager/loadxmlstring-method/llms-full.txt)
