public static String serialize(Node doc){
  StringWriter writer=new StringWriter();
  try {
    serializeNode(doc,"",writer);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  writer.flush();
  return writer.toString();
}

public static String serialize ( Node doc ) { StringWriter writer = new StringWriter ( ) ; try { serializeNode ( doc , "" , writer ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } writer . flush ( ) ; return writer . toString ( ) ; }
serialize the given node .
