code: private static void _writeExtendedComponentTree(Writer writer,
              FacesContext facesContext) throws IOException
      {
          VisitContext visitContext = VisitContext.createVisitContext(
                  facesContext, null, EnumSet.of(VisitHint.SKIP_UNRENDERED));
          facesContext.getViewRoot().visitTree(visitContext, new ExtendedComponentTreeVisitCallback(writer));
          _clearVisitedFacetCountMap(facesContext);
      }
docs: Creates the Extended Component Tree via UIViewRoot.visitTree()
  and ExtendedComponentTreeVisitCallback as VisitCallback.
  
  @param writer
  @param facesContext
  @throws IOException