{
  TemplateNode clone(Stylesheet stylesheet)  {    int len = sortKeys.size();    List sortKeys2 = new ArrayList(len);    for (int i = 0; i < len; i++)      {        sortKeys2.add(((Key) sortKeys.get(i)).clone(stylesheet));      }    len = withParams.size();    List withParams2 = new ArrayList(len);    for (int i = 0; i < len; i++)      {        withParams2.add(((WithParam) withParams.get(i)).clone(stylesheet));      }    TemplateNode ret = new ApplyTemplatesNode(select.clone(stylesheet),                                              mode, sortKeys2, withParams2,                                              isDefault);    if (children != null)      {        ret.children = children.clone(stylesheet);      }    if (next != null)      {        ret.next = next.clone(stylesheet);      }    return ret;  }