Every time I open and close a raster layer in QGIS it creates an xml file for that raster when closing. While I do a lot of automatic processing this really bugs me, since I have to add every time when I request a file list to exclude xml files. I just want QGIS to stop doing this, so do any of you know where to turn this off?
Are the xml files *.aux.xml?
If so, it's not QGIS creating them, it's the GDAL library which uses them to store metadata, including statistics. You can disable completely by setting the environment variable GDAL_PAM_ENABLED=NO though I don't advise this if you'll be displaying the rasters again as there won't be any statistics cached.
Instead, you can tell GDAL to store the aux.xml files in another directory by setting the environment variable GDAL_PAM_PROXY_DIR=some_folder