Following code can be used to remove a XmlNode with all the children nodes
XmlDocument doc = new XmlDocument();
doc .Load(MapPath("~/FileName.xml"));
XmlNodeList selectedNodes = doc .SelectNodes("//SubNode");
foreach (XmlNode node in selectedNodes )
{
node.ParentNode.RemoveChild(node);
}
Regards,
Samitha
XmlDocument doc = new XmlDocument();
doc .Load(MapPath("~/FileName.xml"));
XmlNodeList selectedNodes = doc .SelectNodes("//SubNode");
foreach (XmlNode node in selectedNodes )
{
node.ParentNode.RemoveChild(node);
}
Regards,
Samitha