More refactoring, removing xml_env2 everywhere
Final removal of xml_env2