public String canonSerialize(Node node) throws Exception {
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  canon.setWriter(baos);
  canon.notReset();
  canon.canonicalizeSubtree(node);
  String ret=baos.toString("UTF-8");
  baos.reset();
  return ret;
}

public String canonSerialize ( Node node ) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; canon . setWriter ( baos ) ; canon . notReset ( ) ; canon . canonicalizeSubtree ( node ) ; String ret = baos . toString ( "UTF-8" ) ; baos . reset ( ) ; return ret ; }
use the canonicalizer to serialize the node
