you can find the class library source for the section info extractor
at this link in svn:
<http://bungeni-editor.googlecode.com/svn/plugins/ExtractSections>
(required libraries are odfdom / xerces and log4j , you can find the
correct versions of those
libraries under here :
http://bungeni-editor.googlecode.com/svn/external_libs/ )
It outputs the required information as a string ...
Let me know if this meets your requirements
Ashok