code: public static XContentBuilder marshall(ClientVersionBean bean) throws StorageException {
          try (XContentBuilder builder = XContentFactory.jsonBuilder()) {
              ClientBean client = bean.getClient();
              OrganizationBean org = client.getOrganization();
              preMarshall(bean);
              builder
                  .startObject()
                      .field("organizationId", org.getId())
                      .field("organizationName", org.getName())
                      .field("clientId", client.getId())
                      .field("clientName", client.getName())
                      .field("clientDescription", client.getDescription())
                      .field("version", bean.getVersion())
                      .field("apikey", bean.getApikey())
                      .field("status", bean.getStatus())
                      .field("createdBy", bean.getCreatedBy())
                      .field("createdOn", bean.getCreatedOn().getTime())
                      .field("modifiedBy", bean.getModifiedBy())
                      .field("modifiedOn", bean.getModifiedOn().getTime())
                      .field("publishedOn", bean.getPublishedOn() != null ? bean.getPublishedOn().getTime() : null)
                      .field("retiredOn", bean.getRetiredOn() != null ? bean.getRetiredOn().getTime() : null)
                  .endObject();
              postMarshall(bean);
              return builder;
          } catch (IOException e) {
              throw new StorageException(e);
          }
      }
docs: Marshals the given bean into the given map.
  @param bean the bean
  @return the content builder
  @throws StorageException when a storage problem occurs while storing a bean