src/sap.ui.core/src/sap/ui/core/util/reflection/BaseTreeModifier.js
function(fnCallback, oRootNode) {
			function recurse(oParent, oCurrentNode, bIsAggregation) {
				var oAggregations;
				if (!bIsAggregation) {
					var oMetadata = this._getControlMetadataInXml(oCurrentNode);
					oAggregations = oMetadata.getAllAggregations();
				}
				var aChildren = this._getElementNodeChildren(oCurrentNode);
				aChildren.forEach(function(oChild) {
					var bIsCurrentNodeAggregation = oAggregations && oAggregations[oChild.localName];
					recurse.call(this, oCurrentNode, oChild, bIsCurrentNodeAggregation);
					// if it's an aggregation, we don't call the callback function
					if (!bIsCurrentNodeAggregation) {
						fnCallback(oChild);
					}
				}.bind(this));
			}
			recurse.call(this, oRootNode, oRootNode, false);
		}
function(fnCallback, oRootNode) {
			function recurse(oParent, oCurrentNode, bIsAggregation) {
				var oAggregations;
				if (!bIsAggregation) {
					var oMetadata = this._getControlMetadataInXml(oCurrentNode);
					oAggregations = oMetadata.getAllAggregations();
				}
				var aChildren = this._getElementNodeChildren(oCurrentNode);
				aChildren.forEach(function(oChild) {
					var bIsCurrentNodeAggregation = oAggregations && oAggregations[oChild.localName];
					recurse.call(this, oCurrentNode, oChild, bIsCurrentNodeAggregation);
					// if it's an aggregation, we don't call the callback function
					if (!bIsCurrentNodeAggregation) {
						fnCallback(oChild);
					}
				}.bind(this));
			}
			recurse.call(this, oRootNode, oRootNode, false);
		}
function ( fnCallback , oRootNode ) { function recurse ( oParent , oCurrentNode , bIsAggregation ) { var oAggregations ; if ( ! bIsAggregation ) { var oMetadata = this . _getControlMetadataInXml ( oCurrentNode ) ; oAggregations = oMetadata . getAllAggregations ( ) ; } var aChildren = this . _getElementNodeChildren ( oCurrentNode ) ; aChildren . forEach ( function ( oChild ) { var bIsCurrentNodeAggregation = oAggregations && oAggregations [ oChild . localName ] ; recurse . call ( this , oCurrentNode , oChild , bIsCurrentNodeAggregation ) ; // if it's an aggregation, we don't call the callback function if ( ! bIsCurrentNodeAggregation ) { fnCallback ( oChild ) ; } } . bind ( this ) ) ; } recurse . call ( this , oRootNode , oRootNode , false ) ; }
Recursively goes through an XML tree and calls a callback function for every control inside.
Does not call the callback function for aggregations.

@param {function} fnCallback - Function that will be called for every control with the following arguments: fnCallback(<Element>)
@param {Element} oRootNode - Root node from which we start traversing the tree
Recursively goes through an XML tree and calls a callback function for every control inside . Does not call the callback function for aggregations .