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.

Example

1
2
3
4
5
6
var writer = $Xml.Create();
writer.StartElement('Customer');
writer.Write('Doe');
writer.EndElement();
var xml = writer.ToXml();
// xml: <Customer>Doe</Customer>

See Also