code: private EscEvent createEscEvent(final SerializerRegistry registry,
              final EnhancedMimeType targetContentType, final CommonEvent commonEvent) {
  
          Contract.requireArgNotNull("registry", registry);
          Contract.requireArgNotNull("targetContentType", targetContentType);
          Contract.requireArgNotNull("commonEvent", commonEvent);
  
          final EscMeta meta = EscSpiUtils.createEscMeta(registry, targetContentType, commonEvent);
  
          final String dataType = commonEvent.getDataType().asBaseType();
          final SerializedDataType serDataType = new SerializedDataType(dataType);
          final Serializer dataSerializer = registry.getSerializer(serDataType);
          if (dataSerializer.getMimeType().match(targetContentType)) {
              return new EscEvent(commonEvent.getId().asBaseType(), dataType,
                      new DataWrapper(commonEvent.getData()), new DataWrapper(meta));
          }
  
          final byte[] serData = dataSerializer.marshal(commonEvent.getData(), serDataType);
          return new EscEvent(commonEvent.getId().asBaseType(), dataType,
                  new DataWrapper(new Base64Data(serData)), new DataWrapper(meta));
  
      }
docs: Creates a single "application/vnd.eventstore.events+xml" entry.
  
  @param registry
  Registry with known serializers.
  @param targetContentType
  Type of content that will be created later on.
  @param commonEvent
  Event to marshal.
  
  @return Single event that has to be surrounded by "&lt;Events&gt;&lt;/Events&gt;".