function sth_compare(value, args, xmlNode) { alert(value); //Sort all folders together and all files and then sort on alphabet. return (xmlNode.tagName == "folder" ? 0 : 1) + value; }