code: public static <T> void marshal(T obj, OutputStream s) throws JAXBException {
      JAXBContext ctx = JAXBContext.newInstance(obj.getClass());
      Marshaller m = ctx.createMarshaller();
      m.marshal(obj, s);
    }
docs: Convert an object to a string and send it to an OutputStream.
  
  @param obj Object that needs to be serialized / marshalled
  @param s Stream used for output