Stylistic question: How to break out of a recursive tree processing?

The ideomatic way here would be to use throw+try/catch, not exceptions. It’s not exceptional, but a expected part of your execution flow.