}
private IDocument createDocument(String headerText, String bodyText, ITextEntityRenderer renderer) {
final IDocument document = createEmptyDocument(renderer);
document.addPositionCategory(HttpMessageDocument.SECTION_POSITION_CATEGORY);
document.addPositionUpdater(new DefaultPositionUpdater(HttpMessageDocument.SECTION_POSITION_CATEGORY));
if(bodyText != null && !bodyText.isEmpty()) {
document.set(headerText + bodyText);
addSectionPosition(document, 0, headerText.length());
addSectionPosition(document, headerText.length(), bodyText.length());