def _parse_list(element, definition):
    """Parse xml element by definition given by list.

    Find all elements matched by the string given as the first value
    in the list (as XPath or @attribute).

    If there is a second argument it will be handled as a definitions
    for the elements matched or the text when not.

    :param element: ElementTree element
    :param definition: definition schema
    :type definition: list
    :return: parsed xml
    :rtype: list
    """
    if len(definition) == 0:
        raise XmlToJsonException('List definition needs some definition')

    tag = definition[0]
    tag_def = definition[1] if len(definition) > 1 else None

    sub_list = []

    for el in element.findall(tag):
        sub_list.append(xml_to_json(el, tag_def))

    return sub_list