serialize static method

String serialize(
  1. XmlNode node, {
  2. bool pretty = true,
})

Converts an XmlDocument or XmlNode back to string format.

Implementation

static String serialize(XmlNode node, {bool pretty = true}) {
  try {
    if (pretty) {
      return node.toXmlString(pretty: true, indent: '    ');
    }
    return node.toXmlString();
  } catch (e) {
    throw XmlException('XML Serialization error', e);
  }
}