I was hoping to get some advice and potentially a solution to my problem. This example is just showing the concept of what we're trying to do as the XML structure we hold can be over 2,000 lines. In Oracle we're migrating our code into postgres so this is how we're currently doing it in Oracle and what we're trying to migrate into postgres. One of the problems we're hitting is using MULTIPLE XMLTABLE functions to link nodes with a single XML tag elements to one's with multiple tag elements as show in this example. The problem with the XMLTABLE in postgres we don't seem to be able to pass structures from one XMLTABLE to another to structure the output as we require. Here is a test case example:- CREATE TABLE XML_TABLE ( id NUMERIC(19,0) NOT NULL, resultxml XML ); INSERT into XML_TABLE(ID,RESULTXML) VALUES (1,' AA XX test item 1 29.9 test item 2 30.9 BB ZZ test item 1 30.9 test item 2 40.9 CC YY test item 1 50.9 test item 2 60.9 '); SELECT xt.id , xt1.RESULT_POS, xt1.product, xt1.name, xt2.item_pos, xt2.item_text, xt2.item_value FROM TEST_LOAD.XML_TABLE xt, XMLTABLE('//storedresults/result' PASSING xt.resultxml COLUMNS RESULT_POS FOR ORDINALITY, PRODUCT CHARACTER VARYING(20) path 'product', NAME CHARACTER VARYING(20) path 'name', ITEMS_XML XML PATH '//items/item') xt1, XMLTABLE('item' PASSING xt1.ITEMS_XML COLUMNS ITEM_POS FOR ORDINALITY, ITEM_TEXT CHARACTER VARYING(300) PATH 'text', ITEM_VALUE CHARACTER VARYING(300) PATH 'value') xt2 WHERE xt.id = 1; I get the following error. ERROR: could not parse XML document DETAIL: line 4: Extra content at the end of the document In Oracle it works fine doing this so just wondering if there is another way of doing this in Postgres that is not going to be massive on performance consumption as our the LIVE solution is dealing with high volumes of data which extract data from a large XML structure (this is just an simplified example). Thanks David