I need to remove an XmlNode based on a condition. How to do it?
foreach (XmlNode drawNode in nodeList)
{
//Based on a condition
drawNode.Remove
XmlNodeList xnodeContact = xmldocContact.GetElementsByTagName("contact");
foreach (ListViewItem item in listViewContacts.Items)
{
if (item.Checked)
{
if (item.Index >= 0)
xnodeContact[0].ParentNode.RemoveChild(xnodeContact[0]);
listViewContacts.Items.Remove(item);
}
}
}
xmldocContact.Save(appdataPath + "\\WhatAppcontactList.xml");
Invalidate();