GDP-845

* Close temporary output files
* Delete response xml if exists
Resolved merge conflict