code: public static <T> void marshal(T obj, File f) throws JAXBException {
      JAXBContext ctx = JAXBContext.newInstance(obj.getClass());
      Marshaller m = ctx.createMarshaller();
      m.marshal(obj, f);
    }
docs: Convert an object to a string and save it to a File.
  
  @param obj Object that needs to be serialized / marshalled
  @param f Save file