WIP significant fixes for WriteXMLFiles
WriteXMLFiles not handles multiple image files. Need to check encoding.
I think the version of WriteXMLFiles is OK
removed debug message in ReadXMLFiles