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
ParameterDescription
excludeOptional list of top-level member names to exclude.
prettyPrintEnables multi-line formatting.
indentIndentation 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))