This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XmlDocument xdoc = new XmlDocument(); | |
TextWriter wwriter = new StreamWriter("c:/a.xml"); | |
//Do your logic to add all tags to xdoc | |
////with Tag <?xml version="1.0" encoding="utf-8"?> | |
//xdoc.Save(wwriter); | |
////without tag- <?xml version="1.0" encoding="utf-8"?> | |
XmlWriterSettings xws = new XmlWriterSettings { OmitXmlDeclaration = true }; | |
using (XmlWriter xw = XmlWriter.Create(wwriter, xws)) | |
xdoc.Save(xw); |