explicitly read/write xml files using UTF-8 encoding, improve xml file f...

explicitly read/write xml files using UTF-8 encoding, improve xml file formatting