code: public String serialize(T obj) {
          try {
              Marshaller marshaller = context.createMarshaller();
              marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
              StringWriter writer = new StringWriter();
              marshaller.marshal(obj, writer);
              return writer.toString();
          } catch (JAXBException e) {
              throw new XmlSerializationException("Exception encountered " +
                                                  "serializing report: " +
                                                  getErrorMsg(e), e);
          }
      }
docs: Serializes the data stored within a java bean to XML. The bean and any
  ancillary beans should include JAXB binding annotations.
  
  @param obj to serialize
  @return XML