XmlWriter: using OutputStream instead of Writer to avoid double-encoding of BOM