so let me clarify (still to test and alter your code):

we have a collection of MenuItems. Each item represents a parent menu and also a submenu.
Where the parentID is not null, that is how you identify that it is a submenu.

I want to be able to "compile the list" so that the items are merged correctly i.e a parent has submenus and each of those submenus may have x submenus, and those could have x submenus etc...