code: public static <T> String writeObjectToString(final T entity) {
          ByteArrayOutputStream destination = new ByteArrayOutputStream();
          writeObject(entity, destination, null);
          return destination.toString();
      }
docs: Write XML entity to the string.
  
  @param entity
  XML entity
  @throws IllegalArgumentException
  @throws SwidException
  @param <T>
  JAXB entity