Creates a new XmlWriter instance using the specified filename.
using System; using System.IO; using System.Xml; using System.Text; public class Sample { public static void Main() { using (XmlWriter writer = XmlWriter.Create("output.xml")) { writer.WriteStartElement("book"); writer.WriteElementString("price", "1.9"); writer.WriteEndElement(); writer.Flush(); } } }