I remember trying to do something similar using a custom tag and FaceletHandler etc. In the end all the little rendering-time issues made it not worth the effort. Mind you I was (and still am :-(...) using facelets for jsf 1.1, so not sure if this is better in the later versions.
How dynamic / how many different facelets do you have to deal with? The reason I ask is that you could (to borrow a term from the compiler wizards) unroll your loop. Instead of
<ui:repeat value="#{panels}" var="panel">
<ui:include src="#{panel.facelet}">
</ui:repeat>
You could do
<custom:panelOneFacelet rendered="#{hasPanel1}" />
<custom:panelTwoFacelet rendered="#{hasPanel2}" />
<!-- etc... -->
And in your facelet, you would have something like :
<c:if test="#rendered" >
<!-- EVERYTHING IN THE FACELET HERE!!!-->
</c:if>
This sort of low-tech approach is fine for a small controlled set, but if you have a very large and varying set of facelets this may not work.
Might I ask why, b/c sometimes with an understanding of the high-level, SO gurus may suggest much simpler ideas for accomplishing the same goal