private static void cleanUpRenderedNodes(RenderedNodeCollection nodes) { nodes.CollectionContent.RemoveAll(node => node.IsCategoryFilteringNode == false && node.ActualContentUrl == null); nodes.CollectionContent.RemoveAll(node => node.IsCategoryFilteringNode == false && (node.Categories.CollectionContent == null || node.Categories.CollectionContent.Count == 0)); // Note the node1 and node2 are opposite parameters, because we want descending sort nodes.CollectionContent.Sort((node1, node2) => String.CompareOrdinal(node2.MainSortableText, node1.MainSortableText)); }