I have some XML, say:
14
19&
Possible solution:
Usort would work as follows:
function comp($a, $b) {
return $b->Uses - $a->Uses;
}
usort($xml->Backgrounds, 'comp');
Another way is to use an XSLT, with something like this: