Fix SGML/XML incompability before starting conversion to XML