I have the following XML:
<Root>
<Section name="xyz" />
<Section name="abc">
<Section name="def" />
</Section>
<Section name="abc">
<Section name="def">
<Section name="xyz" />
<Section name="abc" />
<Section name="xyz">
<Section name="xyz" />
</Section>
</Section>
</Section>
</Root>
I have the XDocument representation of the XML. How I do traverse through the tree and remove all elements with say abc
That’s really easy 🙂
Gotta love LINQ to XML…
EDIT: I’ve just tried it with your sample XML, and this was the result afterwards:
Please let me know if that’s not what you were expecting.