'Generate Identity Provider Metadata.
Generate and format metadata into XML that can be exposed and
consumed by a federated Service Provider.
:returns: XML <EntityDescriptor> object.
:raises keystone.exception.ValidationError: If the required
config options aren\'t set.'

def generate_metadata(self):

    self._ensure_required_values_present()
    entity_descriptor = self._create_entity_descriptor()
    entity_descriptor.idpsso_descriptor = self._create_idp_sso_descriptor()
    return entity_descriptor
