def _get_line_element_value(element, line, current_exception):
    """
    Given an element to search for in a line of text,
    return the element's value if found.
    Otherwise, raise the appropriate exception.
    """
    if element in line:
        return line[line.rfind('>')+1:]
    else:
        raise current_exception('Couldn\'t find ' + element + ' in '
                                           + line)