They match up based on the "number" in the Name tag value. From1 matches to Price1 and (of course) I can't be guaranteed that they'll always come in the proper pair order, so I can't just match one and count on the next to come in the next namevalue pair.

So Price2 can come before From1 which comes before From2 and so on.... it is a messed up format, but it is what I have to work with and unfortunately - I have difficulty in finding XSLT syntax to solve it, so I likely have to go another route for my transformation (perhaps a manual transformation or script it).