title: Convert RTF to XML
body: <p>There has already been a lot of questions asked about this and I have read almost all of them. I understand that there is no one library that will do everything we want when RTF is involved.</p>
  
  <p>However, I am looking for a fresh perspective on converting the RTF document in the following format to XML .</p>
  
  <p>This is the format</p>
  
  <pre><code>      01.   AAAAAA
                 01.1 BBBBB
                 01.2 CCCCC
                 01.3 DDDDD
       02.    ZZZZZZ
                 2.1  YYYYYY
                 2.2  XXXXXX
                        2.2.1  SUBSUB
                 2.3  QQQQQ
                 2.4  MMMM
  
  
       03.    GGGGG
                  3.1 LLLLLLLL
                  3.2 NNNNN
  </code></pre>
  
  <p>Basically, the document is not properly structured. It has extra spaces in some places, uneven number of sub lists etc., </p>
  
  <p>Is there any way to convert it into a structred format like an XML that maintains the hierarchy ?</p>
  
  <p>I have looked into Apache Tikka. The library extracts text from the RTF document, but since the doucment is not delimeted properly, I am not sure how hierarchy can be maintained.</p>
  
  <p>Are there any other open source libraries ?</p>
  
  <p>Any suggestions on how to approach this problem ?</p>