This is a following up question to question to \"Select all of an element between the current element and the next of the current element\". Even If I\'m not sure if creatin
Here is a generic solution that will work for any heading depth:
When run on your sample input, this produces:
... ... ... ... ... ... ... ... ... ... ... ... ... ... ...