Fix to xml output

Fix to xml output since the choice of json is no longer needed.
Improve efficiency.