@Override
        public int compare( Node o1, Node o2 )
        {
            try
            {
                final int p1 = o1 instanceof Element ? Integer.parseInt( ((Element)o1).attributeValue( "order", "0" ) ) : 0;
                final int p2 = o2 instanceof Element ? Integer.parseInt( ((Element)o2).attributeValue( "order", "0" ) ) : 0;
                return Integer.compare( p1, p2 );
            }
            catch ( NumberFormatException e )
            {
                Log.warn( "Unable to sort admin console tabs, as a non-numeric 'order' attribute value was found.", e );
                return 0;
            }
        }
A comparator that compares Nodes by the value of their 'order' attribute, if the node is an Element. When it is
not, or when the 'order' attribute is absent, or cannot be parsed as an integer, the value '0' is used.

@author Guus der Kinderen, guus.der.kinderen@gmail.com
xmppserver/src/main/java/org/jivesoftware/admin/AdminConsole.java