Fix wrong logic with writing 'responseXml'