def get_path(data, question_name, path_list):
    """
    A recursive function that returns the xpath of a media file
    :param json data: JSON representation of xform
    :param string question_name: Name of media file being searched for
    :param list path_list: Contains the names that make up the xpath
    :return: an xpath which is a string or None if name cannot be found
    :rtype: string or None
    """
    name = data.get('name')
    if name == question_name:
        return '/'.join(path_list)
    elif data.get('children') is not None:
        for node in data.get('children'):
            path_list.append(node.get('name'))
            path = get_path(node, question_name, path_list)
            if path is not None:
                return path
            else:
                del path_list[len(path_list) - 1]
    return None