Fix XML output bug