code: function initClientRendered(widgetDefs, document) {
      // Ensure that event handlers to handle delegating events are
      // always attached before initializing any widgets
      eventDelegation.init();
  
      document = document || window.document;
      for (var i=0,len=widgetDefs.length; i<len; i++) {
          var widgetDef = widgetDefs[i];
  
          if (widgetDef.children.length) {
              initClientRendered(widgetDef.children, document);
          }
  
          var widget = initWidget(
              widgetDef.type,
              widgetDef.id,
              widgetDef.config,
              widgetDef.state,
              widgetDef.scope,
              widgetDef.domEvents,
              widgetDef.customEvents,
              widgetDef.extend,
              widgetDef.bodyElId,
              widgetDef.existingWidget,
              null,
              document);
  
          widgetDef.widget = widget;
      }
  }
docs: Create a helper function handle recursion