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