/**
         * Serializes a DOM document to String.
         * 
         * Public for other transformation plugins
         * TODO refactor out to own class
         * 
         * @param document The document to serialize.
         * @param output   The Output to print errors to.
         * 
         * @return The serialized document as string.
         */
public static String domToString(Document document) {
		Source source = new DOMSource(document);
		try {
			TransformerFactory factory = TransformerFactory.newInstance();
			Transformer transformer = factory.newTransformer();
			transformer.setOutputProperty(OutputKeys. INDENT, "yes");
			transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1");
			StringWriter sw=new StringWriter();
            StreamResult resultStream = new StreamResult(sw);
            transformer.transform(source, resultStream);
            return sw.toString();
		} catch (TransformerException e) {
			return e.toString();
		}
	}
public static String domToString(Document document) {
Source source = new DOMSource(document);
try {
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys. INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1");
StringWriter sw=new StringWriter();
StreamResult resultStream = new StreamResult(sw);
transformer.transform(source, resultStream);
return sw.toString();
} catch (TransformerException e) {
return e.toString();
}
}
public static String domToString(Document document) {
Source source = new DOMSource(document);
try {
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys. INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1");
StringWriter sw=new StringWriter();
StreamResult resultStream = new StreamResult(sw);
transformer.transform(source, resultStream);
return sw.toString();
} catch (TransformerException e) {
return e.toString();
}
}
public static String domToString(Document document) {
Source source = new DOMSource(document);
try {
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
transformer.setOutputProperty(OutputKeys. INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1");
StringWriter sw=new StringWriter();
StreamResult resultStream = new StreamResult(sw);
transformer.transform(source, resultStream);
return sw.toString();
} catch (TransformerException e) {
return e.toString();
}
}