documentToString

open fun documentToString(document: Node): String

Convert the given org.w3c.dom.Document to an XML String.

This method is a simplified version of the following code

ByteArrayOutputStream out = new ByteArrayOutputStream(); javax.xml.Transformer transformer = TransformerFactory.newInstance().newTransformer(); transformer.transform( new DOMSource( node ), new StreamResult( out )); return out.toString();

...but not all Android API Versions (e.g. Versions javax.xml.transform.Transformer.

Parameters

document

the given document

Throws