klyn.io.xml.dom.XMLSerializer.stringify
method
public static stringify(value as Object, rootName as String = "object", exclude as List<String> = null, prettyPrint as Boolean = true, indent as Int = 4) as String
Description

Converts a value to XML text.

Parameters
ParameterDescription
valueSource value.
rootNameRoot element name.
excludeOptional list of top-level members to skip.
prettyPrintEnables multi-line output.
indentNumber of spaces per indentation level.
Returns

XML representation of the value.

Throws
  • ValueException if the object graph exceeds 64 nested levels (including cycles).
Example
xml = XMLSerializer.stringify(user, "User", ["password"], true, 4)