bool CMarkup::AddChildElem( MCD_CSTR szName, MCD_CSTR szData = NULL, int nFlags = 0 );
bool CMarkup::AddChildElem( MCD_CSTR szName, int nValue, int nFlags = 0 );

The AddChildElem method is called to add a child element after the child position (see InsertChildElem to put it before the child position). If there is no child position, the element is added as the last child element of the main position regardless of whether there are any child elements. Only call this method if there is a main position. After a child element is successfully added, the child position points to the new child element.

The data value is optional. If no data value or an empty string is specified, an empty child element is created. The method returns true if the child element is added successfully and the child position points to it. The main position is not affected by this method.

See AddElem for details of the flags that can be used when adding an element.