Method XmlNode():toXML() Foundation

Returns the XML representation for the XML document or fragment.

Syntax
:toXML() --> cXMLDoc
Return

A character string with the XML representation of the XmlNode() object and its child nodes.

Description

The method :toXML() returns the XML representation of an node and its childs. When executed on a document node, the method returns a valid XML document or fragment. In this regard, :toXML() behaves differently compared to :toString(), which only operates on XML element nodes.

The nodes in the return string are indented to reflect the document's node hierarchy. The indentation used by :toXML() to do this can be changed via the method :setDefaultIndentation().

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.