code: private SectionContainer buildSectionStructure(List<SectionContent> scl)
  	{
  		SectionContainer result = new SectionContainer(0);
  
  		for (SectionContent sContent : scl)
  		{
  			int contentLevel = sContent.getLevel();
  			SectionContainer sContainer = result;
  
  			// get the right SectionContainer or create it
  			for (int containerLevel = result.getLevel() + 1; containerLevel < contentLevel; containerLevel++)
  			{
  				int containerSubSections = sContainer.nrOfSubSections();
  				if (containerSubSections != 0)
  				{
  					Section temp = sContainer
  							.getSubSection(containerSubSections - 1);
  					if (temp.getClass() == SectionContainer.class)
  					{
  						sContainer = (SectionContainer) temp;
  					}
  					else
  					{
  						SectionContainer sct = new SectionContainer(temp
  								.getTitleElement(), containerLevel);
  						sct.addSection(temp);
  						if (calculateSrcSpans)
  						{
  							sct.setSrcSpan(temp.getSrcSpan());
  						}
  						temp.setTitleElement(null);
  						temp.setLevel(containerLevel + 1);
  						sContainer.removeSection(temp);
  						sContainer.addSection(sct);
  						sContainer = sct;
  					}
  				}
  				else
  				{
  					sContainer = new SectionContainer(null, containerLevel);
  				}
  			}
  
  			sContainer.addSection(sContent);
  		}
  
  		if (calculateSrcSpans)
  		{
  			result.setSrcSpan(new SrcSpan(0, -1));
  		}
  
  		return result;
  	}
docs: Takes a list of SectionContent and returns a SectionContainer with the
  given SectionContent s in the right structure.