Click here to Skip to main content
13,556,069 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 23 Aug 2011
Licenced CPOL

Delete an XML node using the node name

, 23 Aug 2011
Rate this:
Please Sign up or sign in to vote.
How to delete an XML node using its name.

Using xml.linq we can delete a node from XML in C#.

XDocument XMLDoc = XDocument.Load(path);
XElement elment = (from xml1 in XMLDoc.Descendants("Node")
                   select xml1).FirstOrDefault();


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


About the Author

India India
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralReason for my vote of 3 Good, but it will fail if no Element... Pin
Kim Togo30-Aug-11 1:51
memberKim Togo30-Aug-11 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180515.1 | Last Updated 23 Aug 2011
Article Copyright 2011 by b4usat
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid