docs: function reduce() {
      if (this._contentType !== contentTypes.html) return this;
      var tree = new Sapling(this._queue, 'name', 'parent');
  
      t.dfs(tree, function each(child, parent) {
        if (parent && parent.name === child.parent) [
          "data-pagelet='"+ child.name +"'",
          'data-pagelet="'+ child.name +'"',
          'data-pagelet='+ child.name,
        ].forEach(function locate(attribute) {
          var index = parent.view.indexOf(attribute)
            , id = '{id-'+ child.name +'}'
            , end;
  
          //
          // As multiple versions of the pagelet can be included in to one single
          // parent pagelet we need to search for multiple occurrences of the
          // `data-pagelet` attribute.
          //
          while (~index) {
            end = parent.view.indexOf('>', index);
  
            if (~end) {
              end += 1;
              parent.view = parent.view.slice(0, end) + id + parent.view.slice(end);
              index = end + id.length;
            }
  
            index = parent.view.indexOf(attribute, index + 1);
          }
        });
      });
  
      //
      // Walk through the tree in reversed order to replace the data
      // added in each view. This has to be done separately otherwise childs
      // at different branches might replace content in the wrong parent
      // due to name collisions.
      //
      t.dfs(tree, { order: 'post' }, function each(child, parent) {
        if (parent && parent.name === child.parent) {
          parent.view = parent.view.replace(
            new RegExp('{id-'+ child.name +'}','g'),
            child.view
          );
        }
      });
  
      //
      // Finally clean up the queue for unprocessed fragments. Only the root
      // element containing the content of the reduced children is allowed to
      // be written to the response. Remaining fragments would destroy the
      // HTML output.
      //
      this._queue = [{
        name: tree.name,
        view: tree.view
      }];
  
      return this;
    }