FileStream oFs = new FileStream("c:\folder\yourfile.xml",FileMode.CreateNew,FileAccess.ReadWrite); StreamWriter oWriter = new StreamWriter(oFs); oWriter.Write(youVariableWithXML); oWriter.Flush(); oWriter.Close(); oFs.Close();If you're using the XMLTextReader to read this XML, it might be a method that could do that as well, but I'm not sure about it.