I have a function that returns the value from a specific tag in an XML document:
XElement elem = XElement.Parse(xml_string);
string ret = elem.Element(key).Value.ToString();
return ret;
I'm trying to figure out how to create another method that returns the full string contents contained within a tag, including child tags and child values.
i.e. if I have:
<foo>
Hello
<child1>val1</child1>
<child2>val2</child2>
</foo>
The method above properly returns 'Hello', but what I want is another method that returns:
Hello<child1>val1</child1><child2>val2</child2>