code: public static <T extends XMLObject> T createAttributeValueObject(QName schemaType, Class<T> clazz) {
      XMLObjectBuilder<?> builder = XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(schemaType);
      XMLObject object = builder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, schemaType);
      return clazz.cast(object);
    }
docs: Creates an {@code AttributeValue} object of the given class and schema type.
  <p>
  After the object has been constructed, its setter methods should be called to setup the value object before adding
  it to the attribute itself.
  </p>
  
  @param <T>
  the type
  @param schemaType
  the schema type that should be assigned to the attribute value, i.e.,
  {@code xsi:type="eidas:CurrentFamilyNameType"}
  @param clazz
  the type of the attribute value
  @return the attribute value
  @see #createAttributeValueObject(Class)