code: private void removeAllResourcesFromViewRoot(final FacesContext context,
                                                  final List<UIComponent> resources,
                                                  final UIViewRoot view) {
          final Iterator<UIComponent> it = resources.iterator();
  
          while (it.hasNext()) {
              final UIComponent resource = it.next();
              final String resourceLibrary = (String) resource.getAttributes().get("library");
  
              removeResource(context, resource, view);
              if (resourceLibrary != null && resourceLibrary.startsWith("butterfaces"))
                  it.remove();
          }
      }
docs: Remove resources from the view.