I have some XML which contains records and sub records, like this:
This might do it, run this following snippet of XSLT when processing the top level
elements:
Essentially this iterates over each sub-
element and creates an
element describing the desired attribute. The position()
function is called to get the relative position within the top level element: 1, 2, 3, etc.
This is not a complete solution; some familiarity with XSLT is assumed.