I have a basic entity that looks like the following:

The entity is the basic entity in a whole tree. Every GPNode has a parent GPNode and a set of children (GPNode). Theoretically the hierarchy could be endless.
I want to do a query using NSPredicate that delivers me all children and children of children etc. of a specific GPNode. Since the number of steps in the hierarchy aren't defined, I can't work with subqueries in the predicate. Any ideas how to achieve my goal? Thanks in advance.