How to delete a node from a xml c#?

DNG

New Member
I have a xml structure like this:-\[code\]<Person id="1" Name="Rahul lamba" Manager_Id="13" Department="IT" /><Person id="6" Name="Saurabh" Manager_Id="4" Department="IT" /><Person id="5" Name="Amitesh" Manager_Id="6" Department="IT" />\[/code\]Now I want to delete Manager_Id node from XML from every line.I tried this but nothing works out\[code\]XmlNodeList l = doc.GetElementsByTagName("Person"); foreach (XmlNode item in l) { foreach (var item1 in item.ChildNodes) { if (item1 == "Manager_Id") { //Code to remove Manager_Id node. } } }\[/code\]How can i achieve this?Thanx in advance.
 
Back
Top