Saves the current node to the specified XmlWriter.
Imports System
Imports System.IO
Imports System.Xml
public class Sample
public shared sub Main()
Dim doc as XmlDocument = new XmlDocument()
doc.LoadXml("<book xmlns:bk='urn:samples' bk:ISBN='1-111111-57-5'>" & _
"<title>C#</title>" & _
"</book>")
Dim root as XmlElement = doc.DocumentElement
root.SetAttribute("genre", "urn:samples", "Computer")
Dim writer as XmlTextWriter = new XmlTextWriter(Console.Out)
writer.Formatting = Formatting.Indented
root.WriteTo(writer)
end sub
end class
Related examples in the same category