private XmlElement DemoteDocumentElement()
{
// Changes of Xml here should not affect ROM
Debug.Assert(_ignoreXmlEvents == true);
// There should be no reason to call this function if docElem is not a rowElem
Debug.Assert(GetRowFromElement(DocumentElement) != null);
// Remove the DocumentElement and create a new one
XmlElement oldDocElem = DocumentElement;
RemoveChild(oldDocElem);
XmlElement docElem = EnsureDocumentElement();
docElem.AppendChild(oldDocElem);
// We should have only one child now
Debug.Assert(docElem.LastChild == docElem.FirstChild);
return docElem;
}
// This function ensures that the special listeners are un-subscribed, the permanent listeners are subscribed and