Fix in creating the stream for the xml file

Also fixed the location of the result xml file