This is an example of how you can shred the XML when the number of elements you want to query are unknown - you will need to use dynamic pivot on this output using the RN column to get the data in the format you described