Creates a new XmlWriter instance using the stream and XmlWriterSettings object.
using System;
using System.IO;
using System.Xml;
using System.Text;
public class Sample {
public static void Main() {
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = true;
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.CloseOutput = false;
MemoryStream strm = new MemoryStream();
XmlWriter writer = XmlWriter.Create(strm, settings);
writer.WriteElementString("orderID", "1");
writer.WriteElementString("orderID", "2");
writer.Flush();
writer.Close();
}
}
Related examples in the same category