ser.setParameter(Constants.DOM_NAMESPACES, Boolean.TRUE);
ser.setParameter(Constants.DOM_WELLFORMED, Boolean.FALSE );
ser.setParameter(Constants.DOM_VALIDATE, Boolean.FALSE);
// the receiver of the DOM
DOMOutputImpl out = new DOMOutputImpl();
out.setEncoding("UTF-8");
// we write into a String
StringWriter writer = new StringWriter(4096);
out.setCharacterStream(writer);
// out, ye characters!
ser.write(node, out);
writer.flush();