def has_sub_sections(node):
    """Test whether or not a section node has children with the tagname
    section.

    The function is going to be used to assess
    whether or not a certain section is the lowest level. Sections
    that have not sub-sections (i.e. no children with the tagname
    section) are assumed to be Beamer slides

    """
    for child in node.children:
        if child.tagname == 'section':
            return True
    return False
