private static void overrideSidebar(Element sidebar, Element overrideSidebar) {
        // Override name.
        overrideCommonAttributes(sidebar, overrideSidebar);
        // Override entries.
        for (Iterator<Element> i=overrideSidebar.elementIterator(); i.hasNext(); ) {
            Element entry = i.next();
            String id = entry.attributeValue("id");
            Element existingEntry = getElemnetByID(id);
            // Simple case, there is no existing sidebar with the same id.
            if (existingEntry == null) {
                sidebar.add(entry.createCopy());
            }
            // More complex case -- an entry with the same id already exists.
            // In this case, we have to overrite only the difference between
            // the two elements.
            else {
                overrideEntry(existingEntry, entry);
            }
        }
    }
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