public static String serialize(Object node){
  String ret=null;
  if (node instanceof String) {
    ret=(String)node;
  }
 else   if (node instanceof byte[]) {
    ret=new String((byte[])node);
  }
 else   if (node instanceof DOMSource) {
    ret=serializeDOMSource((DOMSource)node);
  }
 else   if (node instanceof Node) {
    ret=serializeNode((Node)node);
  }
 else {
    log.severe("Unable to serialize '" + node + "'");
  }
  if (ret != null) {
    ret=ret.trim();
  }
  return ret;
}

public static String serialize ( Object node ) { String ret = null ; if ( node instanceof String ) { ret = ( String ) node ; } else if ( node instanceof byte [ ] ) { ret = new String ( ( byte [ ] ) node ) ; } else if ( node instanceof DOMSource ) { ret = serializeDOMSource ( ( DOMSource ) node ) ; } else if ( node instanceof Node ) { ret = serializeNode ( ( Node ) node ) ; } else { log . severe ( "Unable to serialize '" + node + "'" ) ; } if ( ret != null ) { ret = ret . trim ( ) ; } return ret ; }
this method serializes the supplied xml object to a string .
