Only leaf nodes will have a value. Because, if they have a value, there’s no way we can keep on iterating under them.
My thought was that we still needed the bottom up approach to figure out the tree structure under the entity. Do you think that’s not required?
Actually, maybe you’re right. As we iterate from top-down, if we need more info about some entity, we can just check if that entity exists in the children, and then lazily build it up.