Using Oracle PL SQL to bulk load XML

In performance testing it is often necessary to do bulk loads of data into databases via XML payloads, to prepare for a test. For my example I had to load 250,000 elements via XML to create accounts. The XML structure had one root or top level element with many child elements, also many batches of the root elements. I decided I would perform a commit after constructing each root element, with the corresponding amounts of child elements. I made both the batch number of root elements and the child elements both configurable. This resulted in the following PL SQL code. I have deleted out certain parts of the XML so as to protect client.
Continue reading