This should be sooo easy.
I've got a XMLWriter object
I've got a XMLNode
How do I get the XMLNode.OuterText into the XMLWriteObject without having to go through hoops messing about with streams, textwriters or any other derived stupidity or otherwise writing lines and lines and lines of code when I should be able to do this in about 3 lines
These new readers and writers are rubbish. They just bend my head backwards every time I have to use them. Either I'm very very stupid, or they are just long-winded and illogical
And please microsoft, tell w3c they can have thier own xml dom, just ignore them and write us one that isn't sooooooooooooooooooooooooooo obscure, and is missing some very basic functionality
Honstly, all I want is some pretty xml for a customer so he can read documents in a text editor without first using xml notepad to format it, and I've been stotting my head off a brick wall for half a day so far. It's the same every time i have use xml.
*rant mode off*

how to get some text into a XMLWriter?
Kogivan
code posted on this thread
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=324841&SiteID=1&mode=1
sharad sharma
Sergey (have I said this before ) you are a genius :-). I was so close too, I was trying every method I could to write to the XMLWriter, and I just needed that Node.WriteTo(xmlWriter)
WooHoo!
I'll post some code here so you can all share once it's tidied up
Qanuc
So where is the method in XMLDocument to ouput human-readable XML
eh eh
Asher David
Calm down.
XmlReader and XmlWriter are far from be ideal but not as illogical as you see them now.
When you call xStartNode.OuterXml you already serialize your xStartNode to string.
xtW.WriteRaw() send it to MemoryStram without any processing. (That's why it is "Raw".)
Most likely you need:
Wsettings.Indent=true;
Dim xtW As XmlWriter = XmlWriter.Create(ms, Wsettings)
xStartNode.WriteTo(xtW);
The output will be indented is your document has WS preserved or if you create XmlWriter that performs indentation.
Quammy
Dim ms As New MemoryStream
Dim xtW As XmlWriter = XmlWriter.Create(ms, Wsettings)
xtW.WriteRaw(xStartNode.OuterXml)
xtW.Flush()
There, not obscure at all is it I end up with a nice fat memory stream, full of lovely text that I can't see unless I create another object, a reader, however, it's not working
Who thought this up