def METHOD_NAME(case_output, depth=0):
    for c in case_output['child_cases']:
        METHOD_NAME(c, depth=depth + 1)
    case = case_output['case']
    common_data = {
        'indent_px': depth * TREETABLE_INDENT_PX,
        'submit_url_root': submit_url_root,
        'form_url_root': form_url_root,
        'view_url': get_case_url(case.case_id),
        'session_data': get_session_data(case, current_case, type_info)
    }
    data = type_info.get(case.type, {})
    if 'description_property' in data:
        data['description'] = getattr(case, data['description_property'], None)
    if 'edit_session_data' in data:
        data['session_data'].update(data['edit_session_data'])
    data.update(common_data)
    case.edit_data = data
    if 'child_type' in data and not case.closed:
        child_type = data['child_type']
        child_data = type_info.get(child_type, {})
        child_data.update(common_data)
        child_data.update({
            "link_text": _("Add %(case_type)s") % {
                'case_type': child_data.get('type_name', child_type)
            },
            "parent_node_id": case.case_id,
        })
        if 'create_session_data' in child_data:
            child_data['session_data'].update(child_data['create_session_data'])
        case.add_child_data = child_data