In .NET how can I write an XmlElement to an XmlTextWriter, where the element may have children

54 views Asked by At

Is there an easy (single call) way in .NET to write an XmlElement to a XmlTextWriter where that element is written out in full to the output?

Where the XmlElement may have many child elements and they have children, etc. And where it explicitly adds namespaces as needed.

1

There are 1 answers

0
Martin Honnen On BEST ANSWER

I think the WriteTo method on XmlNode (a base class of XmlElement) can do what you want.

For the issue about namespaces I think you would better add some samples of input/output or where your current approach fails.