I have a question that caused me a terrible headache. Please help me. The input is:
section 1
You don't need to rebuild your XML, take a look here: XSLT Grouping Siblings.