When I open the attached file test.xml in "emacs -Q", Emacs complains in *Warnings*: Warning (emacs): File contents detected as iso-latin-1. Consider adding an xml declaration with the encoding specified, or saving as utf-8, as mandated by the xml specification. The file looks fine to me, I have even used nxml-insert-xml-declaration to re-create the XML declaration. Reproduced in a current build of emacs-26 and on master.