This seems like it should be a simple fix, but I'm getting hung up someplace.

I've loaded up an xml and that was pretty easy, but for some reason I can't sort the data in the xml.

I then put the xml directly into the code so I could limit down the possibility of errors. It traces out nicely, just like the loaded xml, but this sorting command is prematurely aging me.

Code:
var xml:XML = <alist>
			<student name="Darrin Fletcher" films="4" />
			<student name="Tracie Fletcher" films="5" />
			<student name="Chet Thomas" films="7" />
		     </alist>;
				
var sl:XMLList = xml.student;
var item:XML;
for each(item in sl) {
	sort(item.attribute('films'));
	trace('Name: ' + item.attribute('name'));
}