'Dumps the content in standard metadata format or the pysaml2 metadata
format
:param format: Which format to dump in
:return: a string'

def dumps(self, format='local'):

    if (format == 'local'):
        res = EntitiesDescriptor()
        for _md in self.metadata.values():
            try:
                res.entity_descriptor.extend(_md.entities_descr.entity_descriptor)
            except AttributeError:
                res.entity_descriptor.append(_md.entity_descr)
        return ('%s' % res)
    elif (format == 'md'):
        return json.dumps(self.items(), indent=2)
