private void renderElements(Resolution resolution, Result result, SectionHitGroup sectionGroup, List<String> sourceList, List<PageElement> elements) {
        for (PageElement element : elements) {
            if (element instanceof Section) {
                sectionGroup.add(toGroup((Section)element,resolution,result));
            }
            else if (element instanceof Source) {
                addSource(resolution,(Source)element,sectionGroup,result,sourceList);
            }
            else if (element instanceof Renderer) {
                sectionGroup.renderers().add((Renderer)element);
            }
            else if (element instanceof Choice) {
                Choice choice=(Choice)element;
                if (choice.isEmpty()) continue; // Ignore
                int chosen=resolution.getResolution(choice);
                renderElements(resolution, result, sectionGroup, sourceList, choice.alternatives().get(chosen));
            }
            else if (element instanceof Placeholder) {
                Placeholder placeholder =(Placeholder)element;
                List<PageElement> mappedElements=
                        resolution.getResolution(placeholder.getValueContainer()).get(placeholder.getId());
                renderElements(resolution,result,sectionGroup,sourceList,mappedElements);
            }
        }
    }
Creates the hit group corresponding to a section, drawing data from the given result
container-search/src/main/java/com/yahoo/search/pagetemplates/engine/Organizer.java