code: public static String marshal(Object jaxbElement) {
          StringWriter sw ;
          try {
              Marshaller fm = JAXBContext.newInstance(jaxbElement.getClass()).createMarshaller();
              fm.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
              sw = new StringWriter();
              fm.marshal(jaxbElement, sw);
          } catch (JAXBException e) {
              throw new RuntimeException(e);
          }
          return sw.toString();
      }
docs: object -> string