Getting elements text from hierarchy list

But how is this achievable? How to stop the loop, when there are no other descending levels? Thanks for the answer :slight_smile: