public static String docToString1(Document dom){
  StringWriter sw=new StringWriter();
  DOM2Writer.serializeAsXML(dom,sw);
  return sw.toString();
}

public static String docToString1 ( Document dom ) { StringWriter sw = new StringWriter ( ) ; DOM2Writer . serializeAsXML ( dom , sw ) ; return sw . toString ( ) ; }
convert a dom tree into a string using dom2writer
