def _attr2obj(element, attribute, convert):
    """
    Reads text from attribute in element

    :param element: etree element
    :param attribute: name of attribute to be read
    :param convert: intrinsic function (e.g. int, str, float)
    """
    try:
        if element.get(attribute) is None:
            return None
        elif element.get(attribute) == '':
            return None
        return convert(element.get(attribute))
    except Exception:
        None