You need a collection of leaves, from across the composite tree. You need to have access to the parent and/or recurse to the root.
A class that works with a collection of leaf classes, that each point to it's parent. In effect a composite in reverse. Keep all the leaf objects in a collection and build the heirarchy from the bottom up. One of the main reasons behind this is multiple paths to a set endpoint. The root becomes the set endpoint where by we can plot a course from a leaf. The Leaf though is where we start from and full knowledge of all leaves should be known at the outset. By adding a Parent on the Composite (GoF), you can achieve a similar result, but you will not have a flat list of leaves.