public static String serialise(Node node){
  try {
    DOMImplementationRegistry registry=DOMImplementationRegistry.newInstance();
    DOMImplementationLS lsImpl=(DOMImplementationLS)registry.getDOMImplementation("LS");
    LSSerializer serializer=lsImpl.createLSSerializer();
    return serializer.writeToString(node);
  }
 catch (  Exception e) {
    log.fine("could not serialise XML node: " + e);
    return "";
  }
}

public static String serialise ( Node node ) { try { DOMImplementationRegistry registry = DOMImplementationRegistry . newInstance ( ) ; DOMImplementationLS lsImpl = ( DOMImplementationLS ) registry . getDOMImplementation ( "LS" ) ; LSSerializer serializer = lsImpl . createLSSerializer ( ) ; return serializer . writeToString ( node ) ; } catch ( Exception e ) { log . fine ( "could not serialise XML node: " + e ) ; return "" ; } }
serialises the xml node into a string .
