You can use the XMLTABLE function to convert an XML tree structure into zero or more rows:
- Compose an XQuery query that will generate a sequence. Each item of this sequence will generate a corresponding row.
- Determine the row format (column name, type of all the columns) and determine the path expression that will return the value of the column. The path expression should be relative to the items returned by the query in step (1).
- Compose a query which calls the XMLTABLE function to turn the XML documents into rows.