'Add or replace all identities. The identities must be a in set
where each identity is a tuple of the form:
(category, type, lang, name)
If a language is specifified, any identities using that language
will be removed to be replaced with the given identities.
NOTE: An identity\'s language will not be changed regardless of
the value of lang.
Arguments:
identities -- A set of identities in tuple form.
lang       -- Optional, standard xml:lang value.'

def set_identities(self, identities, lang=None):

    self.del_identities(lang)
    for identity in identities:
        (category, itype, lang, name) = identity
        self.add_identity(category, itype, name, lang)
