My guess would be that you need to recreate the file instead of open or create. You probably write over the existing data in the file. If the previous content of the xml file was like this (both numbers are 3 characters long):
="1.0"="utf-8"
<DERMPAMappingTools_MapDetails>
<XPos>684</XPos>
<YPos>731</YPos>
</DERMPAMappingTools_MapDetails>
The new content would not completely overwrite the complete xml, leaving an extra
>
as a last extra character.
Good luck!