I appreciate that there are now many mechanisms in dotnet to deal with XML in a myriad of ways…
Suppose I have a string containing the XML….
<?xml version='1.0' encoding='utf-8' ?> <root> <Element1> <Element1_1> SomeData </Element1_1> </Element1> <Element2> Some More Data </Element2> </root>
What is the simplest (most readable) way of removing Element1_1?
Update… I can use any .Net API available in .Net 3.5 😀
Which APIs are you able to use? Can you use .NET 3.5 and LINQ to XML, for instance? If so, XNode.Remove is your friend – just select Element1_1 (in any of the many ways which are easy with LINQ to XML) and call Remove() on it.
Examples of how to select the element:
Or: