public synchronized static <T>String marshal(T t){
  StringWriter stringWriter=new StringWriter();
  String str="";
  try {
    JAXBContext context=JAXBContext.newInstance(t.getClass());
    Marshaller marshaller=context.createMarshaller();
    marshaller.marshal(t,stringWriter);
    str=stringWriter.toString();
  }
 catch (  JAXBException je) {
    _log.error("Unable to construct XML content.",je);
  }
  return str;
}

public synchronized static < T > String marshal ( T t ) { StringWriter stringWriter = new StringWriter ( ) ; String str = "" ; try { JAXBContext context = JAXBContext . newInstance ( t . getClass ( ) ) ; Marshaller marshaller = context . createMarshaller ( ) ; marshaller . marshal ( t , stringWriter ) ; str = stringWriter . toString ( ) ; } catch ( JAXBException je ) { _log . error ( "Unable to construct XML content." , je ) ; } return str ; }
general method to parse xml content
