public static void RemoveElement(this XmlElement element) { XmlNode parentNode = element.ParentNode; parentNode.RemoveChild(element); }