# XML Programming

> Program XML documents in TXTextControl with XMLElement objects and the XMLElements collection, validate them in XMLEditMode and handle invalid XML events.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control ActiveX > API Reference > Programming Categories > XML Programming
- **472 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/xml/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/xml/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/categories/xml/llms-full.txt

---

When `TXTextControl` edits an XML document, its elements are available as `XMLElement` objects collected in `XMLElements` collections. The members below get these collections, switch the validating edit mode on and report documents that are not valid or not well-formed.

### Controls and Objects

| Member | Description |
|---|---|
| [`XMLElement`](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt) | An `XMLElement` object is an OLE Automation object that represents an element in an XML document. |
| [`XMLElements`](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/llms-full.txt) | An `XMLElements` collection object is an OLE Automation object whose members represent all XML elements with a certain tag name. |

### Properties

| Member | Description |
|---|---|
| [`TXTextControl.XMLEditMode`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/xmleditmode-property/llms-full.txt) | Specifies whether `TXTextControl` operates in an edit mode that validates the XML document according to the document's DTD. |
| [`TXTextControl.XMLElements`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/xmlelements-property/llms-full.txt) | Returns a collection of all XML elements with the same tag name. |

### Events

| Member | Description |
|---|---|
| [`TXTextControl.XMLInvalid`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/xmlinvalid-event/llms-full.txt) | Occurs when a loaded XML document cannot be validated with the document type definition (DTD) referenced in the document. |
| [`TXTextControl.XMLNotWellFormed`](https://docs.textcontrol.com/tx-text-control-activex/reference/txtextcontrol/xmlnotwellformed-event/llms-full.txt) | Occurs when a loaded XML document is not well-formed. |

### Related Pages

- [Working with XML Files](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/llms-full.txt): load, edit and save XML documents.
- [Programming XML Documents](https://docs.textcontrol.com/tx-text-control-activex/document-editor/xml/programming/llms-full.txt): program XML elements in code.
- [XMLElement](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms-full.txt): the members of the XMLElement object.
- [XMLElements](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelements/llms-full.txt): the members of the XMLElements collection.

---

## Nearby

- **Previous:** [Tool Bars](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/toolbars/llms-full.txt)
- **Next:** [Server Programming](https://docs.textcontrol.com/tx-text-control-activex/reference/categories/server/llms-full.txt)
