Allows a self referential collection to be converted into a nested or flat hierarchy