Mega Code Archive

 
Categories / VB.Net / XML
 

Saves the XML document to the specified XmlWriter

Imports System Imports System.Xml public class Sample    public shared sub Main()      Dim doc as XmlDocument = new XmlDocument()     doc.LoadXml("<item><name>wrench</name></item>")     Dim newElem as XmlElement = doc.CreateElement("price")     newElem.InnerText = "10.95"     doc.DocumentElement.AppendChild(newElem)     Dim writer as XmlTextWriter = new XmlTextWriter("data.xml",nothing)     writer.Formatting = Formatting.Indented     doc.Save(writer)   end sub end class