Click here to Skip to main content
11,934,809 members (40,060 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked

Delete an XML node using the node name

, 23 Aug 2011 CPOL
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

SuggestionQuicker approach Pin
NitinNayak29-Jul-15 21:39
memberNitinNayak29-Jul-15 21:39 
GeneralReason for my vote of 3 Good, but it will fail if no Element... Pin
Kim Togo30-Aug-11 2:51
memberKim Togo30-Aug-11 2: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.

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