function findControlClass(sNamespaceURI, sLocalName) {
			var sClassName;
			var mLibraries = Library.all();
			each(mLibraries, function(sLibName, oLibrary) {
				if ( sNamespaceURI === oLibrary.namespace || sNamespaceURI === oLibrary.name ) {
					sClassName = oLibrary.name + "." + ((oLibrary.tagNames && oLibrary.tagNames[sLocalName]) || sLocalName);
				}
			});

			sClassName = sClassName || sNamespaceURI + "." + sLocalName;

			/**
			 * Validates if a control class is available and provides error feedback otherwise.
			 * @param {sap.ui.core.Control|undefined} fnClass control class or undefined if not returned as module content for its sap.ui.define factory
			 * @return {sap.ui.core.Control|undefined} the resolved class.
			 */
			function validateClass(fnClass, sResourceName) {
				if (!fnClass) {
					let sErrorLogMessage = `Control '${sClassName}' did not return a class definition from sap.ui.define.`;
					/**
					 * Some modules might not return a class definition, so we fallback to the global namespace.
					 * This is against the AMD definition, but is required for backward compatibility.
					 * @deprecated
					 */
					(() => {
						fnClass = ObjectPath.get(sClassName);
						if (fnClass) {
							sErrorLogMessage += " The control class was instead retrieved via a deprecated access to the global namespace. This fallback behavior will be removed in the next major version (2.0).";
						}
					})();

					future.errorThrows(`XMLTemplateProcessor: ${sErrorLogMessage}`);
				}

				validateModuleContent(sResourceName, fnClass);

				return fnClass;
			}

			var sResourceName = sClassName.replace(/\./g, "/");
			var oClassObject = sap.ui.require(sResourceName);
			if (!oClassObject) {
				/**
				 * Synchronous loading of control class
				 * @deprecated since 1.120
				 */
				if (!bAsync) {
					oClassObject = sap.ui.requireSync(sResourceName); // legacy-relevant: Sync path
					oClassObject = validateClass(oClassObject, sResourceName);
					return oClassObject;
				}
				return new Promise(function(resolve, reject) {
					sap.ui.require([sResourceName], function(oClassObject) {
						try {
							oClassObject = validateClass(oClassObject, sResourceName);
							resolve(oClassObject);
						} catch (e) {
							reject(e);
						}
					}, reject);
				});
			} else {
				// even when retrieving a class with sap.ui.require, we should validate the module content
				validateModuleContent(sResourceName, oClassObject);
			}
			return oClassObject;
		}
Requests the control class if not loaded yet.
If the View is set to async=true, an async XHR is sent, otherwise a sync XHR.

@param {string} sNamespaceURI
@param {string} sLocalName
@returns {function|Promise|undefined} the loaded ControlClass plain or resolved from a Promise