fix xtemplate gen