Get Tree Items as collection from Tree View in Microsoft Dynamics AX

Hello all,
I am coming to you with the following issue:
I am trying to get all the items from a tree view in Microsoft Dynamics AX 2009. The tree items are open orders that I need to loop through and check and modify different values in each of them.
My current idea is to get somehow all the tree items (orders) into a collection and start looping each order name but I am stuck because I cannot find a method that will help me get this order list into a collection (in a efficient way - Microsoft AX 2009 can be very slow sometimes).
Attached you have a photo of the Microsoft AX Tree View elements that I'm trying to get as a collection. I have to mention that I need them as a list because I need the count of all the orders (reporting) and also after the checks and changes have been done inside a order and the order is closed, it will disappear from the Tree View. That means I always need to cross-check the current list with the initial one (that I'm trying to get).

Does anyone has any hint of how I can achieve such a thing? I'm a bit out of ideas and feel like I have a blocking point.
Have a great day everyone!