use template for loading from xml