* @throws InstantiationException
* @throws IllegalAccessException
*/
public static void writeXmlDocument(OutputStream os, Node node, String encoding, boolean includeXmlDeclaration, boolean enablePrettyPrint) throws ClassCastException, ClassNotFoundException, InstantiationException, IllegalAccessException {
DOMImplementationLS impl = getDomLsImplementation();
LSOutput out = createLSOutput(impl, os, encoding);
LSSerializer writer = createLSSerializer(impl, includeXmlDeclaration, enablePrettyPrint);
writer.write(node, out);
}