You definitely want to start with XMLDB.
XMLDB is a whole world of functions and functionality within itself.
In short, you have three options for storing data w / XMLDB and XMLTYPE.
You can save:
1.) In the CLOB data type. If you do, XML is just in the database, and this is LOB. You cannot index it, search for it, etc. The database is a bucket bit and you are storing XML.
2.) BINARY XML: This is the newest version introduced in 11gR2. This will crash and compress the XML and save in encoded binary format. The advantage here is that you can use Oracle Text and XMLINDEX indexes to index and search for content. This is the option with which I have the most experience. We have a billion documents, an average size of about 12 thousand, stored in the 11gR2 database. This works very well for us.
3.) XML for relational mapping: you define a relational schema to store data in your XML schema and determine how XML elements are mapped to relational tables and fields. When swallowed, XML is decomposed and stored in a traditional relational model. Then you can search, sort, index, like any traditional database.
It really depends on what you want to do, as to which XML storage model you choose.
You can ask your questions in the Oracle XMLDB forum. This is quite active, and there are people who are much more knowledgeable on this issue than I am. https://forums.oracle.com/forums/forum.jspa?forumID=34
Hope this helps.
Reply to update 1:
I really have experience with binary XML storage, sorry. I think checking the XMLDB code in OTN would be helpful.
Please look:
http://www.oracle.com/technetwork/indexes/samplecode/xmldb-sample-523617.html
source share