If I have an XmlNode
like this
<element attribute="value">
Content
</element>
I can get its InnerXml
("Content
"), but how can I get the opposite? That is, just the outer markup separated by its opening tag and closing tags:
<element attribute="value">
and
</element>
I want to exclude the inner xml, so the OuterXml
property on the XmlNode
class won't do.
Do I have to build it manually by grabbing each piece and formatting them in a string? If so, besides the element's name, prefix and attributes, what other property can XML elements come with that I should remember to account for?