in reply to XML templates + variables??

In addition to the Perl templating systems others have mentioned, if the data to be merged into the XML template is itself in an XML document then you should definitely consider the standard XML templating language XSLT.

You can process XSLT using XML::LibXSLT or XML::XSLT but if the purpose of the exercise is to generate a display in a modern web browser then this is unneccessary - you simply send the data XML to the browser with a processing instruction telling the browser where to find the template (aka XSL stylesheet).