The encoding defined when creating the object is overriden when loading xml from file.