code: public <TYPE> void write(@NotNull final TYPE obj, @NotNull final Writer writer, @NotNull final JAXBContext jaxbContext)
              throws MarshalObjectException {
  
          Contract.requireArgNotNull("obj", obj);
          Contract.requireArgNotNull("writer", writer);
          Contract.requireArgNotNull("jaxbContext", jaxbContext);
  
          try {
              final Marshaller marshaller = jaxbContext.createMarshaller();
              marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);
              marshaller.marshal(obj, writer);
          } catch (final JAXBException ex) {
              throw new MarshalObjectException("Unable to write XML to writer", ex);
          }
      }
docs: Marshals the object as XML to a writer.
  
  @param obj
  Object to marshal.
  @param writer
  Writer to write the object to.
  @param jaxbContext
  Context to use.
  
  @throws MarshalObjectException
  Error writing the object.
  
  @param <TYPE>
  Type of the object.