# TextControl.GetXmlElements Method

> Returns a collection of XML elements. It is an object of the type XmlElementCollection.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 16.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.GetXmlElements Method
- **391 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getxmlelements-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getxmlelements-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getxmlelements-method/llms-full.txt

---

### Description

Returns a collection of XML elements. It is an object of the type [XmlElementCollection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/xmlelementcollection/llms-full.txt).

### Syntax

```csharp
public XmlElementCollection GetXmlElements(string elementName);
```

```vbnet
Public Function GetXmlElements(elementName As String) As XmlElementCollection
```

### Parameters

| Parameter | Description |
|---|---|
| elementName | Specifies the XML element's name. |

### Return Value

The return value is a collection containing all XML elements of the specified name.

### Examples

The following example retrieves xml elements from the text control.

```csharp
var result = textControl.GetXmlElements("CustomerName");
Console.WriteLine($"Get Xml Elements result: {result}");
```

```vbnet
Dim result = textControl.GetXmlElements("CustomerName")
Console.WriteLine($"Get Xml Elements result: {result}")
```

---

## Nearby

- **Previous:** [TextControl.GetVersionInfo Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/getversioninfo-method/llms-full.txt)
- **Next:** [TextControl.HeaderFooterActivated Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/headerfooteractivated-event/llms-full.txt)
