Ported txml to work with current code