bool CMarkup::InsertSubDoc( MCD_CSTR szSubDoc );

Similar to the AddSubDoc method, the InsertSubDoc method is called to insert a markup string subdocument before the current parent position. The subdocument is inserted before the main position or as the first child of the parent position if there is no main position. After the subdocument is successfully inserted, the main position points to the containing element of the new subdocument.

The method returns true if the subdocument is well-formed and inserted successfully and the main position points to it.

See Subdocuments and Fragments of XML Documents.