You can do this using any templating engine, like Smarty for PHP