I am storing the data in the tables however, the XML which comes in has 1000s of nodes/containers and multiple subroot elements. Therefore I decided to take 1 subroot at a time process the schema, validate the data and then store it on the table. I used xquery to perform these actions.