Hi.
Quite a simple question I guess.
I have this xml file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<tasks>
<subject>
<id>123</id>
<headline>a big headline</headline>
<content>important stuff</content>
</subject>
<subject>
<id>222</id>
<headline>even bigger headline</headline>
<content>important stuff 2</content>
</subject>
<subject>
<id>333</id>
<headline>a small one</headline>
<content>important stuff333</content>
</subject>
</tasks>
With C# I have loaded this file using Xdocument:
XDocument xmlDoc = XDocument.Load(@"C:\tasks.xml");
Now how do I remove a <subject> element (with all it´s nodes) based on what ID element it has?
And lets say that that the ID is not a sub-element, but an attribute like this:
<subject id="333">
<headline>a small one</headline>
<content>important stuff333</content>
</subject>
then how can i remove that one?
Thanks alot for your help!