Fixed generator to also output Text elements when printing sections,
subsections and subsubsections.