Check whether the -- is not allowed within the comments according to the XML syntax. >>>>templates/test.tpl <?xml version="1.0" ?> <foo> <!-- foo -- bar --> </foo> >>>>data.php $this->tpl->printComments = true; >>>>expected.txt Opt_XmlComment_Exception