rebuild xtemplate