OK so maybe I didn't express myself correctly
I need that the result will be like that: (the </ will start after the HEADING1 or HEADING2 and so will end with /> before the next HEADING1 or HEADING2 and so)
1. HEADING1
</ aaaaaaaaaa
bbbbbbb
1.1 ccccccccc
1.2 dddddddddd
1.2.1 eeeeeeeee
/>
2. HEADING1
</ aaaaaaaaaaa
/>
2.1 HEADING2
</ ddddddddd
ddddddddddddd
/>
3. HEADING1
|