Fixed a PowerShell memory leek when saving XML containing for non-english characters