def _traverse(data, path):
    """
    Recursively get the value specified by `path` from `data`.
    Return None if the path does not lead to a value.

    >>> nested_dict = {'root': {'nested_key': 'nested_value'}}
    >>> _traverse(nested_dict, ['root', 'nested_key'])
    'nested_value'
    >>> _traverse(nested_dict, ['root', 'nonexistent_key'])
    >>> _traverse(nested_dict, ['nonexistent_root', 'nonexistent_key'])
    """
    def get_next_dict_value():
        return data.get(path[0])

    def get_next_list_value():
        return data[0]


    if not data:
        return None

    # Determine dataType and traverse accordingly
    if isinstance(data, dict):
        if len(path) == 1:
            return get_next_dict_value()
        return _traverse(get_next_dict_value(), path[1:])
    elif isinstance(data, list):
        if len(data) == 1:
            return get_next_list_value()
        return _traverse(get_next_list_value(), path[1:])
    return None