code: function () {
        this.removeChildInstances();
  
        if (this.template) {
          // temporarily assign a new node to get the content in a doc fragment
          this.vscope=this.parent.vscope; // to come back to original state, when the scope has not been changed by the template
          var targs=this.getTemplateArguments(), cargs=this.getCptArguments();
          var realNode = this.node;
          var df = doc.createDocumentFragment();
          this.node = df;
          this.template.call(this, targs, cargs); // WARNING: this changes vscope to the template vscope
  
          realNode.insertBefore(df, this.node2);
          this.replaceNodeBy(df , realNode); // recursively remove doc fragment reference
          // now this.node=realNode
          this.isDOMempty = false;
        }
    }
docs: Create the child nodes for a dynamic template - this method assumes
  that node1 and node2 exist