Return complex type element with name *typename*

def get_complexType(self, typename):
        """Return complex type element with name *typename*"""
        if typename.startswith('a:'):
            typename = typename[2:]
        xpath = "./xsd:complexType[@name='%s']" % typename
        for xsd in self.__xsd_trees:
            elms = xsd.xpath(xpath)
            if len(elms):
                return elms[0], xsd.nsprefix
        raise KeyError("no complexType named '%s' found" % typename)