'Add a new identity element. Each identity must be unique
in terms of all four identity components.
Multiple, identical category/type pairs are allowed only
if the xml:lang values are different. Likewise, multiple
category/type/xml:lang pairs are allowed so long as the names
are different. In any case, a category and type are required.
Arguments:
category -- The general category to which the agent belongs.
itype    -- A more specific designation with the category.
name     -- Optional human readable name for this identity.
lang     -- Optional standard xml:lang value.'

def add_identity(self, category, itype, name=None, lang=None):

    identity = (category, itype, lang)
    if (identity not in self._identities):
        self._identities.add(identity)
        id_xml = ET.Element(('{%s}identity' % self.namespace))
        id_xml.attrib['category'] = category
        id_xml.attrib['type'] = itype
        if lang:
            id_xml.attrib[('{%s}lang' % self.xml_ns)] = lang
        if name:
            id_xml.attrib['name'] = name
        self.xml.append(id_xml)
        return True
    return False
