Writes given XML document to given stream. Uses UTF8 encoding, indentation, preserves spaces. Adds XML declaration with standalone set to "yes". @param doc DOM document to output @param os Stream to output to @throws IOException If an error occurs with serialization
(final Document doc,
final OutputStream os)