Mega Code Archive

 
Categories / C# / XML
 

Save the current node to the specified XmlWriter

using System; using System.IO; using System.Xml; public class Sample {   public static void Main() {     XmlDocument doc = new XmlDocument();     doc.LoadXml("<book xmlns:bk='urn:samples' bk:ISBN='1-111111-57-5'>" +                 "<title>C#</title>" +                 "</book>");     XmlNode root = doc.FirstChild;     Console.WriteLine("Display the root node...");     XmlTextWriter writer = new XmlTextWriter(Console.Out);     writer.Formatting = Formatting.Indented;     root.WriteTo(writer);   } }