'Remove all identities. If a language was specified, only
remove identities using that language.
Arguments:
lang -- Optional, standard xml:lang value.'

def del_identities(self, lang=None):

    for id_xml in self.findall(('{%s}identity' % self.namespace)):
        if (lang is None):
            self.xml.remove(id_xml)
        elif (id_xml.attrib.get(('{%s}lang' % self.xml_ns), None) == lang):
            self._identities.remove((id_xml.attrib['category'], id_xml.attrib['type'], id_xml.attrib.get(('{%s}lang' % self.xml_ns), None)))
            self.xml.remove(id_xml)
