private void PromoteChild(XmlNode child, XmlNode prevSibling)
{
// It makes no sense to move rowElemChild on the same level
Debug.Assert(child.ParentNode != prevSibling.ParentNode);
// prevSibling must have a parent, since we want to add a sibling to it
Debug.Assert(prevSibling.ParentNode != null);
Debug.Assert(IsFoliationEnabled == false);
Debug.Assert(IgnoreXmlEvents == true);
// Should not insert after docElem node
Debug.Assert(prevSibling != DocumentElement);
if (child.ParentNode != null)
child.ParentNode.RemoveChild(child);
Debug.Assert(child.ParentNode == null);
prevSibling.ParentNode.InsertAfter(child, prevSibling);
}