Basically you have a model and all these items including a root item listed. I want to restructure this so items are contained within their parents such to this
Any ideas what the best way to do this would be? This is just an example of the format. Just a note that the original order and number of the items essentially has not order with respect to hierarchy.