code: private Statement generateFunctionBodyForSoyElement(TemplateNode node) {
      String soyElementClassName = this.getSoyElementClassName();
      Expression firstElementKey =
          // Since Soy element roots cannot have manual keys (see go/soy-element-keyed-roots),
          // this will always be the first element key.
          JsRuntime.XID.call(Expression.stringLiteral(node.getTemplateName() + "-0"));
  
      VariableDeclaration elementInstanceDeclaration =
          VariableDeclaration.builder("element")
              .setRhs(
                  SOY_IDOM
                      .dotAccess("$$tryGetElement")
                      .call(INCREMENTAL_DOM, id(soyElementClassName), firstElementKey))
              .build();
      Statement maybeCreateElement =
          Statement.ifStatement(
                  elementInstanceDeclaration.ref().tripleEquals(Expression.LITERAL_NULL),
                  elementInstanceDeclaration
                      .ref()
                      .assign(
                          Expression.construct(
                              id(soyElementClassName), JsRuntime.OPT_DATA, JsRuntime.OPT_IJ_DATA))
                      .asStatement())
              .build();
  
      Statement elementRenderInvocation =
          elementInstanceDeclaration
              .ref()
              .dotAccess("renderInternal")
              .call(INCREMENTAL_DOM, JsRuntime.OPT_DATA)
              .asStatement();
  
      return Statement.of(maybeCreateElement, elementInstanceDeclaration, elementRenderInvocation);
    }
docs: Generates main template function body for Soy elements. Specifically, generates code to create
  a new instance of the element class and invoke its #render method.