update buffer for xtemplate