Sorting - We're Doing It Wrong | Rodney Rehm: "Sorting DOMElements
A trivial function to sort the children of a DOMElement looks like:
$.fn.sortChildren = function(compare) {
var $children = this.children();
$children.sort(compare);
this.append($children);
return this;"
'via Blog this'