fn close_section_at_level(xml: &mut String, state: &XmlState, target: usize)
Closes section if at or above the given level.