# AddChild Method

> Adds an XMLElement as a sub-element at the position the DTD gives, optionally before or after a child; returns 0 on error, 1 if invalid, 2 on success.

- **Product:** TX Text Control ActiveX
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Text Control ActiveX > API Reference > XMLElement > AddChild Method
- **Web URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/llms-full.txt

---

## On This Page

- [Syntax](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/#syntax)
- [Parameters](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/#parameters)
- [Return Value](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/#return-value)
- [Examples](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/#examples)
- [See Also](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/addchild-method/#see-also)

---

## Nearby

- **Previous:** [XMLElement Object](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/llms.txt)
- **Next:** [AutoSelect Property](https://docs.textcontrol.com/tx-text-control-activex/reference/xmlelement/autoselect-property/llms.txt)
