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;
	}
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 ; }
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.