Added xml support for templates