'Create a list of Attribute instances.
:param attrvals: A dictionary of attributes and values
:return: A list of Attribute instances'

def to_(self, attrvals):

    attributes = []
    for (key, value) in attrvals.items():
        key = key.lower()
        try:
            attributes.append(factory(saml.Attribute, name=self._to[key], name_format=self.name_format, friendly_name=key, attribute_value=do_ava(value)))
        except KeyError:
            attributes.append(factory(saml.Attribute, name=key, attribute_value=do_ava(value)))
    return attributes
