Skip to content

ToXml

Returns the XML content generated by the XmlWriter as a string.

1
myXmlWriter.ToXml():string

Returns

The XML content as a string.

Remarks

This method finalizes the XML document and returns the complete XML content as a string.

Examples

Get the XML and parse it for further processing

1
2
3
4
5
var writer = $Xml.Create();
writer.StartElement('Customer').Element('Name', 'Doe').EndElement();

var customer = $Xml.Parse(writer.ToXml());
var name = customer.Evaluate('Name');                     // 'Doe'

See Also