Click here to Skip to main content
11,484,435 members (66,824 online)
Click here to Skip to main content

Tagged as

Delete an XML node using the node name

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

Comments and Discussions

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    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.150520.1 | Last Updated 23 Aug 2011
Article Copyright 2011 by b4usat
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid