klyn.Object.toXml
method

    public toXml(exclude as List<String> = null, prettyPrint as Boolean = true, indent as Int = 4) as String:

Description

Returns the object as XML text.

The XML tree is built through the pure Klyn DOM implementation in `klyn.io.xml.dom`, then serialized by `XMLSerializer`.

Parameters

Parameter | Description
--- | ---
`exclude` | Optional list of top-level member names to exclude.
`prettyPrint` | Enables multi-line formatting.
`indent` | Indentation size. When `prettyPrint` is true and `indent` is 0, a default indentation of 4 spaces is used.

Returns

XML representation of the object.

Example

    import klyn.math

    r = Rational(3, 4)
    print(r.toXml(prettyPrint=true, indent=2))