code: private UIComponent findHeader(UIViewRoot root) {
  		for (UIComponent c : root.getChildren()) {
  			if (c instanceof HtmlHead)
  				return c;
  		}
  		for (UIComponent c : root.getChildren()) {
  			if (c instanceof HtmlBody)
  				return null;
  			if (c instanceof UIOutput)
  				if (c.getFacets() != null)
  					return c;
  		}
  		return null;
  	}
docs: Looks for the header in the JSF tree.
  
  @param root The root of the JSF tree.
  @return null, if the head couldn't be found.