Leveled – Terms foreach

Why not use wp_list_categories( 'taxonomy=section' ) ? It’ll do all the nesting & hard work for you!

If you want more control over the HTML output, implement a custom walker.