code: public <TYPE> void write(@NotNull final TYPE obj, @NotNull final File file, @NotNull final JAXBContext jaxbContext)
              throws MarshalObjectException {
  
          Contract.requireArgNotNull("obj", obj);
          Contract.requireArgNotNull("file", file);
          Contract.requireArgNotNull("jaxbContext", jaxbContext);
  
          try {
              final FileWriter fw = new FileWriter(file);
              try {
                  write(obj, fw, jaxbContext);
              } finally {
                  fw.close();
              }
          } catch (final IOException ex) {
              throw new MarshalObjectException("Unable to write XML to file: " + file, ex);
          }
      }
docs: Marshals the object as XML to a file.
  
  @param obj
  Object to marshal.
  @param file
  File to write the instance to.
  @param jaxbContext
  Context to use.
  
  @throws MarshalObjectException
  Error writing the object.
  
  @param <TYPE>
  Type of the object.