I have to generate XML documents in PL/SQL from some tables in Oracle. I have never done this before, and I have found there seem to be a few main ways to do it:
- xmldom API
- xml functions (such as xmlelement, xmlagg, xmlroot)
- dbms_xmlgen functions
There are 65 tables that will be referenced to generate a single document, and I will have to validate the output against an xsd. The documents will be generated in a batch (rather than on-demand) - I don't know if that makes a difference. Using Oracle 10g.
I was initially leaning towards using the xmldom package as it looked more flexible, but I am having trouble finding good examples or documentation for it, whereas the xml functions seem better documented and generally more popular. Is there a reason for this?
What approach do people generally recommend for this type of task?