I have no theory about why Xy sometimes adds EOF characters. But since (a major virtue) Xy saves files as pure ASCII, you could probably edit it in an ASCII editor like notepad or editpad or emacs without bothering to go through word, which will then add all sorts of things to your file.