function templateWith(oElement, oWithControl) {
				var oBindingInfo,
					oModel,
					oNewWithControl,
					fnHelper,
					sHelper = oElement.getAttribute("helper"),
					vHelperResult,
					sPath = oElement.getAttribute("path"),
					oPromise,
					sResolvedPath,
					sVar = oElement.getAttribute("var");

				if (sVar === "") {
					error("Missing variable name for ", oElement);
				}
				oNewWithControl = new With();
				oWithControl.setChild(oNewWithControl);

				oBindingInfo = BindingParser.simpleParser("{" + sPath + "}");
				sVar ??= oBindingInfo.model; // default variable is same model name

				if (sHelper || sVar) { // create a "named context"
					oModel = oWithControl.getModel(oBindingInfo.model);
					if (!oModel) {
						error("Missing model '" + oBindingInfo.model + "' in ", oElement);
					}
					sResolvedPath = oModel.resolve(oBindingInfo.path,
						oWithControl.getBindingContext(oBindingInfo.model));
					if (!sResolvedPath) {
						error("Cannot resolve path for ", oElement);
					}
					vHelperResult = oModel.createBindingContext(sResolvedPath);
					if (sHelper) {
						fnHelper = getObject(sHelper);
						if (typeof fnHelper !== "function") {
							error("Cannot resolve helper for ", oElement);
						}
						vHelperResult = fnHelper(vHelperResult);
					}
					oPromise = SyncPromise.resolve(vHelperResult);
					if (oViewInfo.sync && oPromise.isPending()) {
						error("Async helper in sync view in ", oElement);
					}
					oPromise = oPromise.then(function (vHelperResult0) {
						if (vHelperResult0 instanceof Context) {
							oModel = vHelperResult0.getModel();
							sResolvedPath = vHelperResult0.getPath();
						} else if (vHelperResult0 !== undefined) {
							if (typeof vHelperResult0 !== "string" || vHelperResult0 === "") {
								error("Illegal helper result '" + vHelperResult0 + "' in ",
									oElement);
							}
							sResolvedPath = vHelperResult0;
						}
						oNewWithControl.setModel(oModel, sVar);
						oNewWithControl.bindObject({
							model : sVar,
							path : sResolvedPath
						});
					});
				} else {
					sResolvedPath = sPath;
					oNewWithControl.bindObject(sResolvedPath);
					oPromise = oSyncPromiseResolved;
				}

				return oPromise.then(function () {
					iNestingLevel++;
					debug(oElement, sVar, "=", sResolvedPath);
					if (oNewWithControl.getBindingContext(sVar)
							=== oWithControl.getBindingContext(sVar)) {
						// Warn and ignore the new "with" control when its binding context is
						// the same as a previous one.
						// We test identity because models cache and reuse binding contexts.
						warn(oElement, "Set unchanged path:", sResolvedPath);
						oNewWithControl = oWithControl;
					}

					return liftChildNodes(oElement, oNewWithControl).then(function () {
						oElement.parentNode.removeChild(oElement);
						debugFinished(oElement);
						iNestingLevel -= 1;
					});
				});
			}
Processes a <template:with> instruction.

@param {Element} oElement
  the <template:with> XML DOM element
@param {sap.ui.core.util._with} oWithControl
  the parent's "with" control
@returns {sap.ui.base.SyncPromise}
  A sync promise which resolves with <code>undefined</code> as soon as the
  <template:with> instruction has been fully processed, or is rejected with a
  corresponding error if visiting of child nodes fails.
@throws {Error}
  If the "var" attribute is present with an empty value, or if the "path" attribute
  refers to a missing model, or if the "helper" attribute does not refer to a
  function which is currently in scope, or if that helper function returns a result
  which is not a non-empty string.