<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def html_listify(tree, root_ul_element, parent_id=None):
 """Recursively construct HTML nested list version of book tree. The original caller should not call this function with the `parent_id` defined. """

    request = get_current_request()
    is_first_node = parent_id is None
    if is_first_node:
        parent_id = tree[0]['id']
    for node in tree:
        li_elm = etree.SubElement(root_ul_element, 'li')
        a_elm = etree.SubElement(li_elm, 'a')
        a_elm.text = node['title']
        if node['id'] != 'subcol':
            if is_first_node:
                a_elm.set('href', request.route_path(
                    'content', ident_hash=node['id'], ext='.html'))
            else:
                a_elm.set('href', request.route_path(
                    'content',
                    separator=':',
                    ident_hash=parent_id,
                    page_ident_hash=node['id'],
                    ext='.html'))
        if 'contents' in node:
            elm = etree.SubElement(li_elm, 'ul')
            html_listify(node['contents'], elm, parent_id)