Check whether the XML prolog works. >>>>templates/test.tpl foo <?xml version="1.0" ?> <foo> </foo> >>>>data.php $this->tpl->prologRequired = true; >>>>expected.txt Opt_XmlInvalidCharacter_Exception