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

The InsertElem method is called to add an element before the main position (see AddElem to put it after the main position). If there is no main position, the element is added as the first element under the current parent position. After an element is successfully inserted, the main position points to the new element and there is no child position.

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