for (ResourceReferenceAndStringData data : coll)
{
ResourceReference ref = data.getReference();
if (ref instanceof AbstractResourceDependentResourceReference)
{
AbstractResourceDependentResourceReference parent = (AbstractResourceDependentResourceReference)ref;
R childColl = newResourceReferenceCollection(key);
for (AbstractResourceDependentResourceReference child : parent.getDependentResourceReferences())
{
childColl.add(toData(child));
}
// render the group of dependencies before the parent
renderCollection(alreadyRendered, key, childColl);