def find_attribute_value(xml_el, namespace, attribute_name):
    """
    Extract the value from an XML element attribute.

    :param xml_el: lxml etree Element
    :param namespace: string for the XML element's namespace prefix
    :param attribute_name: attribute string to retrieve the value from
    :return: value string for the given attribute_name
    """
    attribs = xml_el.xpath(
        '@%s:%s' % (namespace, attribute_name),
        namespaces=xml_el.nsmap,
        smart_strings=False
    )
    attribs_cnt = len(attribs)

    if attribs_cnt > 1:
        raise ValueError(
            "Multiple %s attributes found (line %d)" % (
                attribute_name, xml_el.sourceline
            )
        )
    elif attribs_cnt == 0:
        return None

    # return as pure str to save memory (otherwise it's an _ElementUnicodeResult from lxml)
    return str(attribs[0])