Hi all,
I simply want to read from an xml document and output a subset of it to a string. That is, consider the following xml:
Code:
<animals>
<fish type='water'>SwordFish</fish>
<monkey type='land'>Ape</monkey>
</animals>
I use an XmlTextReader to read through this xml. When I read the <monkey> element I want to output the xml to a string so that my string will look like:
Code:
string = "<monkey type='land'>Ape</monkey>
When I use the ToString() method my string contains just the text value of the element (string = "Ape").
How can I get the actual xml?
Thanks!