bool CMarkup::AddChildSubDoc( MCD_CSTR szSubDoc );

Similar to AddSubDoc, the AddChildSubDoc method is called to add a markup string subdocument in as a child element of the current main position element. The subdocument is added after the child position or as the last child if there is no child position. Only call this method if there is at least a main position. After a child element (subdocument) is successfully added, the child position points to the new child element.

The method returns true if the child subdocument is well-formed and added successfully and the child position points to it. The main position is not affected by this method.

See Subdocuments and Fragments of XML Documents.

CMarkup xml;
xml.AddElem( "DOC" );
xml.AddChildSubDoc( "<SUB>Hello World</SUB>\r\n" );
<SUB>Hello World</SUB>