Added XML output functionality.