# Item Method

> Returns the XML element at a position from 1 to Count of an XMLElements collection; Item is the default method, with a Basic example of three equal forms.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > XMLElements > Item Method
- **465 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/item-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/item-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/item-method/llms-full.txt

---

Returns a specific XML element of an [XMLElements](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/llms-full.txt) collection.

### Syntax

```vbscript
XMLElements.Item Index
```

### Parameters

| Parameter | Description |
|---|---|
| Index | Specifies the position of the XML element in the collection. It must be a number from 1 to the value of the collection's [Count](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/count-property/llms-full.txt) property. If this value does not match any existing member of the collection, an error occurs. |

### Return Value

The method returns an [XMLElement](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt) object.

### Data Types

| Name | Data type |
|---|---|
| Index | Long |
| Return value | [XMLElement Object](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt) |

### Examples

The following Basic example displays the content of the second Address element in an XML document that contains addresses. Because the Item method is the default method of the [XMLElements](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/llms-full.txt) collection and the [Text](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/text-property/llms-full.txt) property is the default property of the [XMLElement](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt) object the three lines of code are equivalent:

```vbscript
MsgBox TXTextControl1.XMLElements("Address").Item(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2).Text

MsgBox TXTextControl1.XMLElements("Address")(2)
```

### See Also

- [Working with XML Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/llms-full.txt)
- [XMLElement Object](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt)
- [XMLElements Collection](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/llms-full.txt)
- [Programming Category: XML Programming](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/xml/llms-full.txt)

---

## Nearby

- **Previous:** [InputItemIndex Property](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/inputitemindex-property/llms-full.txt)
- **Next:** [Remove Method](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/remove-method/llms-full.txt)
