Create a nested format of data collection. Make sure to sort the collection by level (ASC) and position (ASC).