Write XML document to console : XML Write « XML « C# / C Sharp






Write XML document to console

 
using System;
using System.Xml;

public class HelloXML {
  public static void Main(string [] args) {
    XmlTextWriter writer = new XmlTextWriter(Console.Out);
    writer.WriteStartDocument( );
    writer.WriteElementString("www.java2s.com", "XML");
    writer.WriteEndDocument( );
    writer.Close( );
  }
}

           
         
  








Related examples in the same category

1.Create XML document with XmlWriter
2.Read and Write XML Without Loading an Entire Document into MemoryRead and Write XML Without Loading an Entire Document into Memory
3.Writing XML with the XmlWriter ClassWriting XML with the XmlWriter Class
4.Write To XML File
5.Illustrates the XmlTextWriter class
6.XML Write: comment, start element, end element, attribute
7.Create XmlWriter using the static XmlWriter.Create method.