I have a list and I need to sort it to this hierarchy

```
{ Id=1, ParentId = null, Name = "Item1", Type="0"}
   { Id=2, ParentId = 1, Name = "ItemChild1", Type="1"}
   { Id=3, ParentId = 1, Name = "ItemChild2", Type="1"}
        { Id=4, ParentId = 3, Name = "ItemGrandChild1", Type="2"}
   { Id=5, **ParentId = 1**, Name = "ItemGrandChild2", Type="2"}

{ Id=6, ParentId = null, Name = "Item7", Type="0"}
...

```

Unlike normal parent child relationships, here

Items of Type2 can be child of either Type1 or Type0

All the Id's are guids

I have seen may stack answers on child parent sorting using Linq. But my case is different.
Any elegant way using Linq ?