OdfContentDom content = getContentDom();
textTableOfContent = content
.newOdfElement(TextTableOfContentElement.class);
textTableOfContent.setTextNameAttribute("Table of Contents");
textTableOfContent.setTextProtectedAttribute(true);
TextTableOfContentSourceElement textTableOfContentSource = textTableOfContent
.newTextTableOfContentSourceElement();
textTableOfContentSource.setTextOutlineLevelAttribute(10);
textTableOfContentSource.setTextUseIndexMarksAttribute(true);
TextIndexTitleTemplateElement textIndexTitleTemplate = textTableOfContentSource
.newTextIndexTitleTemplateElement();