code: public static void serializeAsXML(Node node, Writer writer) {
          PrintWriter out = new PrintWriter(writer);
          print(node, out);
          out.flush();
      }
docs: Serialize this node into the writer as XML.
  
  @param writer
  Writer object
  @param node
  DOM node