Change sortout.py to use ElementTree for XML output