code: public static Data valueOf(final String type, final Object obj) {
          return new Data(type, mimeType(obj), content(obj));
      }
docs: Creates a new instance from a given object.
  
  @param type
  Name of the type.
  @param obj
  Object to convert.
  
  @return Either JSON or XML UTF-8 encoded content without a version.