Don't use recursion for outlining, as malformed documents with thousands of unclosed tags crash with StackOverflow