I have some XML which contains records and sub records, like this:
Here's a complete solution:
Note that I changed the name of your attributes to "r1", "r2", etc., because XML doesn't allow you to start a name with a number.