# XmlElementCollection.GetItem Method

> Returns a particular XML element from the collection.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > XmlElementCollection.GetItem Method
- **484 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/xmlelementcollection/getitem-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/xmlelementcollection/getitem-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/xmlelementcollection/getitem-method/llms-full.txt

---

### Description

Returns a particular XML element from the collection.

### Syntax

#### GetItem()

Returns the item with the current input position.

```csharp
public XmlElement GetItem();
```

```vbnet
Public Function GetItem() As XmlElement
```

#### GetItem(int)

Returns the item with the specified index.

```csharp
public XmlElement GetItem(int index);
```

```vbnet
Public Function GetItem(index As Integer) As XmlElement
```

| Parameter | Description |
|---|---|
| index | The one based index of the XmlElement. |

### Return Value

The return value is the requested element or null, if the element does not exist.

### Examples

The following example retrieves item from the xml element collection.

```csharp
XmlElement result = xmlElementCollection.GetItem(1);
result?.Select();
```

```vbnet
Dim result As XmlElement = xmlElementCollection.GetItem(1)
If result IsNot Nothing Then result.Select()
```

---

## Nearby

- **Previous:** [XmlElementCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/xmlelementcollection/getenumerator-method/llms-full.txt)
- **Next:** [XmlElementCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/xmlelementcollection/remove-method/llms-full.txt)
