I have a question that caused me a terrible headache. Please help me. The input is:
section 1
The issue is that your XML isn't structured enough for a simple XSLT solution.
The different "section"s are not really setup in a way that is easy to extract them. If you have control over the input XML see if you can change it to something like this:
section 1
some code
following code
following code
section 2
other code
following code
following code
section 3
still other code
following
following
This will let you define a xsl-template for "section"s in which you can xsl-foreach over the "code" classes.