Convert xml to table
You can create a relational view over an xml table using XMLTABLE syntax.
eg. SELECT warehouse name of warehouse, warehouse 2. "Water", warehouse 2. "Railroad" From warehouses, XMLTABLE ('/ Warehouse' PASSING warehouses.warehouse_spec COLUMNS "Water" varchar2 (6) PATH '/ Warehouse / WaterAccess', "Rail "varchar2 (6) PATH '/ Warehouse / RailAccess') warehouse2;
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions228.htm
source to share
Perhaps you need Hyperjaxb?
It can build database schemas from XML and vice versa, and generate object bindings for converting between DB and XML and vice versa:
source to share
Depending on what you are ultimately trying to do, the easy way is to use the XMLSequence () and Table () functions in SQL to convert the node node from the Xpath to a row source:
SELECT
t.extract( '/bar/@id' ).getNumberVal() ID
FROM
TABLE( XMLSEQUENCE(
XMLTYPE(
'<foo><bar id="1" /><bar id="2" /></foo>'
).extract( '//bar' )
) ) t
source to share