Query to get a sorted list of the complete (root to child) path of an Apex list.
The case statement to determine the menu_target is not bulletproof, but it works.
Therefore I left it as a varchar2, and then outer joined it to the application_pages view.
It handles these types of targets:
Note that the query does not take the application_id into account - shouldn't be a problem in most cases.