private static function SortByNavIndex(array &$result)
    {
        $sorted = array();
        foreach ($result as $bundle=>$modules)
        {
            ksort($modules);
            $sorted[$bundle] = $modules;
        }
        return $sorted;
    }