Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / XML

Delete an XML node using the node name

0.00/5 (No votes)
24 Aug 2011CPOL 14.1K  
Can't you do the same thing without the need for a select statement?XElement xElement = XElement.Load(path);xElement.Elements (Node).Remove();xElement.Save(path);

Can't you do the same thing without the need for a select statement?


C#
XElement xElement = XElement.Load(path);
xElement.Elements ("Node").Remove();
xElement.Save(path);

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)