function renderAsFragment(
    template, templateData = undefined, injectedData = undefined,
    domHelper = undefined) {
  const dom = domHelper || googDom.getDomHelper();
  const output = /** @type {?SanitizedContent} */ (
      template(templateData || defaultTemplateData, injectedData));
  if (output && output.renderAsElement) {
    return output.renderAsElement();
  }
  const html = ensureTemplateOutputHtml(output);
  assertFirstTagValid(html.getTypedStringValue());
  return dom.safeHtmlToNode(html);
}
Renders a Soy template into a single node or a document
fragment. If the rendered HTML string represents a single node, then that
node is returned (note that this is *not* a fragment, despite the name of the
method). Otherwise a document fragment is returned containing the rendered
nodes.
@param {function(ARG_TYPES, ?CompatibleIj=): *} template The Soy
    template defining the element's content. The kind of the template must be
    "html" or "text".
@param {ARG_TYPES=} templateData The data for the template.
@param {?Object=} injectedData The injected data for the template.
@param {?googDom.DomHelper=} domHelper The DOM helper used to create DOM
    nodes; defaults to `goog.dom.getDomHelper`.
@return {!Node} The resulting node or document fragment.
@template ARG_TYPES