code: public static RequestedAttribute create(String name, String friendlyName, String nameFormat, Boolean isRequired) {
      XMLObjectBuilder<? extends XMLObject> builder = XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(
        RequestedAttribute.DEFAULT_ELEMENT_NAME);
      Object object = builder.buildObject(RequestedAttribute.DEFAULT_ELEMENT_NAME);
      RequestedAttribute ra = RequestedAttribute.class.cast(object);
      ra.setName(name);
      ra.setFriendlyName(friendlyName);
      ra.setNameFormat(nameFormat != null ? nameFormat : Attribute.URI_REFERENCE);
      ra.setIsRequired(isRequired);
      return ra;
    }
docs: Creates a {@code RequestedAttribute} object for the given attribute name.
  
  @param name
  the attribute name
  @param friendlyName
  the attribute friendly name (optional)
  @param nameFormat
  the name format (defaults to {@code urn:oasis:names:tc:SAML:2.0:attrname-format:uri} if the value is not
  supplied)
  @param isRequired
  flag to tell whether the attribute is required
  @return a {@code RequestedAttribute} object