public toXml(exclude as List<String> = null, prettyPrint as Boolean = true, indent as Int = 4) as String:
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.
| 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. |
XML representation of the object.
import klyn.math r = Rational(3, 4) print(r.toXml(prettyPrint=true, indent=2))