How To Write To An XML File
using System;
using System.Xml;
namespace ConsoleApplication3
{
class Class1
{
static void Main(string[] args)
{
string filename = @"c:\authors.xml";
XmlTextWriter textwriter = new XmlTextWriter(filename,null);
textwriter.Formatting = Formatting.Indented;
textwriter.WriteStartDocument();
textwriter.WriteStartElement("Author");
textwriter.WriteStartElement("Name","Steven M. Swafford");
textwriter.WriteElementString("URL","http://www.aspalliance.com");
textwriter.WriteEndElement();
textwriter.WriteEndElement();
textwriter.WriteEndDocument();
textwriter.Flush();
textwriter.Close();
}
}
}