writeXMLfile: improve file open pattern for better exception-handling.
writeXMLfile: improve file open pattern for better exception-handling.

pombredanne/nTLP,necozay/tulip-control,pombredanne/nTLP,tulip-control/tulip-control,necozay/tulip-control,necozay/tulip-control,tulip-control/tulip-control,pombredanne/nTLP,tulip-control/tulip-control,necozay/tulip-control,tulip-control/tulip-control,necozay/tulip-control