Acme.PROJECTNAME.Install.XmlHelper.RemoveElement C# (CSharp) Method

RemoveElement() public static method

public static RemoveElement ( XmlDocument document, string XPath ) : void
document XmlDocument
XPath string
return void
		public static void RemoveElement(XmlDocument document, string XPath)
		{
			XmlNode parentNode = null;
			XmlNodeList nodes = null;

			nodes = document.SelectNodes(XPath);
			foreach (XmlElement node in nodes)
			{
				parentNode = node.ParentNode;
				node.RemoveAll();
				parentNode.RemoveChild(node);
			}
		}

Same methods

XmlHelper::RemoveElement ( XmlElement element ) : void