def tagnorm(self, tag_or_elem):
        """Normalize the tag name, optionally stripping namespaces and
        downcasing.  'elem' may be an Element or a string"""

        if ET.iselement(tag_or_elem):
            tag = tag_or_elem.tag
        else:
            tag = tag_or_elem
            
        if self.no_ns:
            res = self.STRIP_NS.sub('', tag)
        else:
            res = tag

        if self.downcase:
            res = res.lower()

        return res
Normalize the tag name, optionally stripping namespaces and
        downcasing.  'elem' may be an Element or a string
recipes/Python/511472_Simple_maps_and_lists_from_XML/recipe-511472.py