View formatted XML?

  • Thread starter Thread starter Tarun Mistry
  • Start date Start date
T

Tarun Mistry

Hi everyone, is it possible to return the formatted interpretation of an
XmlDocument object?

Using an XmlWriter object I can write a formatted document to a file,
however I want to store it within a string var and output to the screen.

Is this possible?

Thanks,
Taz
 
XmlTextWriter class has overloaded constructors, one of which accepts a
target stream (could be, for example, a Memorystream). When you are done, you
can call then System.Text.Encoding.UTF8.GetString(yourstream.ToArray())
and get your string.
 
Back
Top