Q:

PLSQL: insert xml values into table without specifing columns

I generated an xml containing all the rows of my table using  dbms_xmlgen.getxmltype:
select dbms_xmlgen.getxmltype('select * from MyTable') from dual;

So I have an xml like this:
    <ROWSET>
    <ROW>
     <ID>1</ID>
     <SURNAME>Smith</SURNAME>
      <NAME>John</NAME>
      <ADDRESS>XXX</ADDRESS>
    </ROW>
    <ROW>
     <ID>2</ID>
     <SURNAME>Allen</SURNAME>
     <NAME>Jim</NAME>
     <ADDRESS>YYY</ADDRESS>
     </ROW>
   </ROWSET>

Is it possible to re-insert the values from XML above into the same table dinamically without specifing any column name? 

A:

dbms_xmlsave can do that for you.  In it's most basic form
declare
   myxml clob;
   rowsv number;
   ctx dbms_xmlsave.ctxType;
begin null;
   my_xml := --  XML data
   ctx := dbms_xmlsave.newcontext('myTable');
   rows := dbms_xmlsave.insertxml(ctx,myxml);
   dbms_xmlsave.closecontext(ctx);
end;
/

Oracle documentation

