public static MenuItemHierarchyItem CreateFromModel(NavigationManagementViewModel model) {
            var usedItems = new List<MenuItemEntry>();
            var result = new MenuItemHierarchyItem(null);
            //create root elements
            foreach (var item in model.MenuItemEntries)
            {
                if (!item.Position.Contains(SEPARATOR)) {
                    result.Children.Add(new MenuItemHierarchyItem(item));
                    usedItems.Add(item);
                }
            }
            foreach (var item in result.Children) {
                var childUsedItems = CreateChildrenFromModel(item, model);
                usedItems.AddRange(childUsedItems);
            }
            
            foreach (var item in model.MenuItemEntries.Except(usedItems).ToList()) {
                result.Children.Add(new MenuItemHierarchyItem(item));
                usedItems.Add(item);
            }

            //set order
            SetOrder(result.Children, 0);

            return result;
        }
        private static List<MenuItemEntry> CreateChildrenFromModel(MenuItemHierarchyItem hitem, NavigationManagementViewModel model)
        {
            var usedItems = new List<MenuItemEntry>();

            var startStr = hitem.Item.Position + SEPARATOR;
            foreach (var item in model.MenuItemEntries) 
            {
                if (item.Position.StartsWith(startStr) && item.Position.LastIndexOf(SEPARATOR) == startStr.Length - 1) {
                    hitem.Children.Add(new MenuItemHierarchyItem(item));
                    usedItems.Add(item);
                }
            }
            foreach (var item in hitem.Children) usedItems.AddRange(CreateChildrenFromModel(item, model));
            return usedItems;
        }