def country_code(xml_el, namespaces):
    """Find the country code for this element"""
    if xml_el.get("class"):
        return xml_el.get("class").split()[-1]
    elif xml_el.find("svg:path", namespaces) is not None:
        return country_code(xml_el.find("svg:path", namespaces), namespaces)
    else:
        return country_code(xml_el.find("svg:g", namespaces), namespaces)