private static void orderModel()
    {
        final Visitor visitor = new VisitorSupport()
        {
            @Override
            public void visit( Element node )
            {
                // This orders only the elements from the content, which can get messy if mixed content is of importance.
                // At the time of writing, the content other than elements was whitespace text (for indentation), which
                // is safe to ignore.
                node.content().sort(new ElementByOrderAttributeComparator());
                super.visit( node );
            }
        };
        generatedModel.accept( visitor );
    }
Sorts all tabs, their containing sidebars, and their containing entries based on the value of their 'order'
attributes.
xmppserver/src/main/java/org/jivesoftware/admin/AdminConsole.java