Most efficient way to load XML file data into tables

I have a complex XML file running into MBs. I want to load it's data into 7-8 tables.
Which way will be better:
1) Use SQL Loader to actually load directly into the 7-8 tables directly by modifying the control card.
Is this really possible and feasible? I am not even sure about it
2) Load data as XML Type in a table and register it. Then extract from there to load into various tables.
Please help. I have to find the most efficient way of doing it.
Regards,
Sudhir

Yes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
So where does that leave you?
Some options
{thread:id=410714} (see page 2)
{thread:id=1090681}
{thread:id=1070213}
Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
Hope all that helps as a starter.
Edited by: A_Non on Jul 8, 2010 4:31 PM
A great example, see the answers by mdrake in {thread:id=1096784}

Similar Messages

  • OWB11gR2 - simple and easy way to load XML formatted data into db tables?

    Hi,
    we're currently trying to load table data stored in XML files into our datawarehouse using OWB 11gR2.
    However, we're finding this is not quite as trivial as loading flat files...
    Most postings on this forum points to the blog-entry title "Leveraging XDB" found here (http://blogs.oracle.com/warehousebuilder/2007/09/leveraging_xdb.html).
    This blog also references the zip-file owb_xml_etl_utils.zip, which seems to have disappeared from it's original location and can now be found on sourceforge.
    Anyway, the solution described is for OWB 10g, and when trying to import experts from the zip-file etc. we end up not being able to run the "Create ETL from XSD" expert, as the 11gR2 client is different from the 10g and does not have the Experts menu et.al.
    Also, this solution was published over 3 years ago, and it seems rather strange that importing XML-formatted data should still be so cumbersome in the newer warehouse builder releases.
    The OWB 11gR2 documentation is very sparse (or rather - quite empty) on how to load XML data, all it has is a few lines on "XML Transformations", giving no clue as to how one goes about loading data.
    Is this really the state of things? Or are we missing some vital information here?
    We'd have thought that with 11g-releases, loading XML-data would be rather simple, quick and painless?
    Is there somewhere besides the blog mentioned above where we can find simple and to the point guidelines for OWB 11gR2 on how to load XML-formatted data into Oracle tables?
    Regards,
    -Haakon-

    Yes it is possible to use SQL*Loader to parse and load XML, but that is not what it was designed for and so is not recommended. You also don't need to register a schema, just to load/store/parse XML in the DB either.
    So where does that leave you?
    Some options
    {thread:id=410714} (see page 2)
    {thread:id=1090681}
    {thread:id=1070213}
    Those talk some about storage options and reading in XML from disk and parsing XML. They should also give you options to consider. Without knowing more about your requirements for the effort, it is difficult to give specific advice. Maybe your 7-8 tables don't exist and so using Object Relational Storage for the XML would be the best solution as you can query/update tables that Oracle creates based off the schema associated to the XML. Maybe an External Table definition works better for reading the XML into the system because this process will happen just once. Maybe using WebDAV makes more sense for loading XML to be parsed (I don't have much experience with this, just know it is possible from what I've read on the forums). Also, your version makes a difference as you have different options available depending upon the version of Oracle.
    Hope all that helps as a starter.
    Edited by: A_Non on Jul 8, 2010 4:31 PM
    A great example, see the answers by mdrake in {thread:id=1096784}

  • Error occured while inserting XML file data into table.

    Hello,
    I m trying to load xml data into table by following code.but getting below error
    Error at line 1
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00222: error received from SAX callback function
    ORA-06512: at "SYS.DBMS_XMLSTORE", line 78
    ORA-06512: at line 21
    DECLARE
      xmldoc   clob;
      insCtx   DBMS_XMLStore.ctxType;
      dname    varchar2(20) := 'MDIR';
      rows  number;
    BEGIN
        xmldoc := dbms_xslprocessor.read2clob(dname, 'try_xm3.xml');
        insCtx := DBMS_XMLStore.newContext('try1');
    dbms_output.put_line('1');
        DBMS_XMLStore.setRowTag(insCtx, 'cajas');
    rows := DBMS_XMLStore.insertXML(insCtx, xmlDoc);
    commit;
      dbms_output.put_line('INSERT DONE '||TO_CHAR(rows));
      DBMS_XMLStore.closeContext(insCtx);
    END;
    <?xml version="1.0" encoding="utf-8"?>
    <cajas xmlns="PBcion.Caja" fec="2011-03-02T14:20:14" codDeleg="093">
      <caj codPrev="80001223" fechaInicio="2011-03-02" fec="2011-09-02" couta="01" idPerio="1" caj="32"></caj>
    </cajas>can you please look into this?
    I m using oracle 10g

    SQL> create table try1
      2  (
      3  codPrev number,
      4  fechaInicio varchar2(25),
      5  fec varchar2(25),
      6  couta number,
      7  idPerio number,
      8  caj number
      9  );
    Table created
    SQL>
    SQL> insert into try1 (codprev, fechainicio, fec, couta, idperio, caj)
      2  select x.codprev, x.fechainicio, x.fec, x.couta, x.idperio, x.caj
      3  from xmltable(
      4         xmlnamespaces(default 'PBcion.Caja')
      5       , '/cajas/caj'
      6         passing xmltype(bfilename('TEST_DIR','try_xm3.xml'), nls_charset_id('AL32UTF8'))
      7         columns codPrev     number       path '@codPrev'
      8               , fechaInicio varchar2(25) path '@fechaInicio'
      9               , fec         varchar2(25) path '@fec'
    10               , couta       number       path '@couta'
    11               , idPerio     number       path '@idPerio'
    12               , caj         number       path '@caj'
    13       ) x
    14  ;
    1 row inserted
    SQL> select * from try1;
       CODPREV FECHAINICIO               FEC                            COUTA    IDPERIO        CAJ
      80001223 2011-03-02                2011-09-02                         1          1         32
    Since the two date attributes are coming in the W3C's xs:date format, you can directly define the corresponding columns as DATE and use a DATE projection in XMLTable :
    SQL> alter table try1 modify (fechainicio date);
    Table altered
    SQL> alter table try1 modify (fec date);
    Table altered
    SQL>
    SQL> insert into try1 (codprev, fechainicio, fec, couta, idperio, caj)
      2  select x.codprev, x.fechainicio, x.fec, x.couta, x.idperio, x.caj
      3  from xmltable(
      4         xmlnamespaces(default 'PBcion.Caja')
      5       , '/cajas/caj'
      6         passing xmltype(bfilename('TEST_DIR','try_xm3.xml'), nls_charset_id('AL32UTF8'))
      7         columns codPrev     number       path '@codPrev'
      8               , fechaInicio date         path '@fechaInicio'
      9               , fec         date         path '@fec'
    10               , couta       number       path '@couta'
    11               , idPerio     number       path '@idPerio'
    12               , caj         number       path '@caj'
    13       ) x
    14  ;
    1 row inserted
    SQL> select * from try1;
       CODPREV FECHAINICIO FEC              COUTA    IDPERIO        CAJ
      80001223 02/03/2011  02/09/2011           1          1         32

  • Load xml file data in oracle 9i table

    Hi,
    I have oracle 9i R2 (9.2.0.8) and currently i am loading data using sql*loader as i am getting text file. I will be getting file in XML format shortly.
    I would like tp know if there is a sql*loader way to load xml file or another easy method that i can use it?
    If you can provide me very simplest way, i will really appreciate it.
    Thanks,

    Please refer
    http://download-uk.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb25loa.htm

  • Most efficient way to consume log files

    Hello everyone,
    I've been absent from the forums for awhile but I'm back at it now... 
    I have a question about the most efficient way to consume log files.  I read in Powershell in action, by Bruce Payette that using a switch statement with a regex worked pretty well, that being said I haven't tried it yet. Select-string is working pretty
    well for me but I have about 10 different entry types that I need to search logs for every 5 minutes and I'm scanning about 15 GB of logs at every interval.  Anyway, if anyone has information about how to do something like that as quickly as possible
    I'd appreciate it.
    1.  piping log files that meet my criteria to select-string
       - This seems to work well but I don't like searching the same files over and over again
    2. running logs through get-content and then building a filter statement
      - This is ok but it seems to use up a fair bit of memory
    3. Some other approach that I haven't thought of yet.
    Anyway, I know this is a relatively nebulous question, sorry about that.  I'm hoping that someone on here knows a really good way to find strings in logs files quickly.
    Hope that helps! Jason

    You can sometimes squeeze out more speed at the expense of memory usage, but filters are pretty fast. I don't see a benefit to holding the whole file in memory, in this case.
    As I mentioned earlier, though, C# code will usually blow PowerShell away in terms of execution time.  Here's a rewrite of what I just did (just for the INI Section pattern, to keep the post size down):
    $string = @'
    #Comment Line
    [Ini-Style Section Line]
    Key = Value Line
    192.168.0.1 localhost
    Some line that doesn't match anything.
    Set-Content -Path .\test.txt -Value $string
    Add-Type -TypeDefinition @'
    using System;
    using System.Text.RegularExpressions;
    using System.Collections;
    using System.IO;
    public interface ILineParser
    object ParseLine(string line);
    public class IniSection
    public string Section;
    public class IniSectionParser : ILineParser
    public object ParseLine(string line)
    object o = null;
    Match match = Regex.Match(line, @"^\s*\[([^\]]+)\]\s*$");
    if (match.Success)
    o = new IniSection() { Section = match.Groups[1].Value };
    return o;
    public class LogParser
    public static IEnumerable ParseFile(string fileName, ILineParser[] lineParsers)
    using (StreamReader sr = File.OpenText(fileName))
    string line;
    while ((line = sr.ReadLine()) != null)
    foreach (ILineParser parser in lineParsers)
    object result = parser.ParseLine(line);
    if (result != null)
    yield return result;
    $parsers = @(
    New-Object IniSectionParser
    $results = [LogParser]::ParseFile("$pwd\test.txt", $parsers)
    $results
    Instead of defining separate classes for each type of line and output object, you could probably do something more generic with delegates (similar to how I used ScriptBlock.Invoke() in the PowerShell example), but it might sacrifice some speed to do so.

  • Loading XML File to Physical table in BW

    Hi,
    I have a requirement to load XML file BW physical table.
    The XML file that I am getting looks pretty complex compared to the XML file I have seen online.
    I need help in transforming the file and Abap code to load the file to physical table
    I have already created the table in SE11.
    XML file
    <?xml version="1.0"?>
    <?mso-application progid="Excel.Sheet"?>
    <Row ss:AutoFitHeight="0" ss:Height="36">
        <Cell ss:StyleID="s62"><Data ss:Type="String">First Name</Data></Cell>
        <Cell ss:StyleID="s62"><Data ss:Type="String">Bank Name -
    add. info</Data></Cell>
       </Row>
       <Row ss:AutoFitHeight="0" ss:Height="22.5" ss:StyleID="s67">
        <Cell><Data ss:Type="String">John Mayor</Data></Cell>
        <Cell><Data ss:Type="String">New: Local bank</Data></Cell
       </Row>
    my requirement is to get this values into physical table i.e
    First name                 bank name
    John Mayor               new: local bank
    thanks
    Edited by: Bhat Vaidya on Apr 14, 2010 11:59 AM
    Edited by: Bhat Vaidya on Apr 14, 2010 12:00 PM
    Edited by: Bhat Vaidya on Apr 14, 2010 12:01 PM
    Edited by: Bhat Vaidya on Apr 14, 2010 12:01 PM

    No longer working on the issue.

  • Load flat file data into ODS in BI

    Dear Gurus,
    How to load flat file data into ODS?. Please share the article if you have.
    advance wishes
    Thanks
    Venkadesh

    Please search the forums before posting :
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60debae1-84dd-2b10-e7bf-bdedf1eabdf9
    http://wiki.sdn.sap.com/wiki/display/BI/Beginner+Section

  • I am giving my old MacBook Air to my granddaughter.  What is the most efficient way to erase all the data on it?

    I am giving my old MacBook Air to my granddaughter.  What is the most efficient way to erase the data?

    You have two options.....
    One is to do a clean reinstall of your OS - if you still have the USB installer that came with your Macbook Air...
    The second option is to create a new user (your granddaugher's name).....Deauthorize your Macbook Air from your Itunes and Appstore.....
    Restart your Macbook after you've created your granddaughter's user name, login under your granddaughter's username and delete your username.
    Search your Macbook for your old files and delete them.....
    Good luck...

  • What's the most efficient way to serve a file from a servlet?

    I have a servlet that does various different things depending on the needs. Sometimes it dynamically generates content, and sometimes all it does is send a file out, with no alteration.
    What is the most efficient way to just send a file?
    One option:
    OutputStream os = response.getOutputStream();
    InputStream is = new FileInputStream(...)
    (send all the bytes from is to os, the regular way using a buffer)Another option is to say:
    RequestDispatcher rd = response.getRequestDispatcher(fileName);
    rd.forward();Any other options? What's the prefered way of doing this?
    I know the rule of "don't optimize too early" but this is a situation where we need to get the maximum amount of files served with the hardware we have, and it's going to be a lot of static files, so efficiency is important.
    Thanks

    Ok, that's what I thought. It would be nice if there were a "response.sendStream(InputStream input)" method in the ServletResponse class. Even nicer would be a sendFile or sendChannel or something. This is probably a common usage and it's a place where the container has many opportunities for optimization. For example, it could call the operating systems send_file kernel call so the entire transfer would be done directly from the disk controller to the ether card (on systems that support that).
    For now I'll just do my own buffered copy.

  • Loading wave file data into array

    Greetings
    For starters, I'm still learning java, so forgive me if this is a trivial question. I've been using the documentation on the java sound api as a guide. What I am trying to do is to load a wav file data into a byte array and eventually I will need it to have it in an int array so I can pass the data into a demodulation algorithm to display as an image. This wave file is a recorded signal from a NOAA satellite. Here is my code thus far:
    public boolean loadFile(File soundFile) {
              int totalFramesRead = 0;
              boolean result=false;
              File fileIn = new File(soundFile.getPath());
              try {
                   AudioInputStream ais = AudioSystem.getAudioInputStream(soundFile);
                   int bytesPerFrame = ais.getFormat().getFrameSize();
                   // Set an arbitrary buffer size of frames.
                   int numBytes = 1024*bytesPerFrame;
                   byte[] audioByte= new byte[numBytes];
                   try {
                        int numBytesRead = 0;
                        int numFramesRead = 0;
                        // Try to read numBytes bytes from the file.
                        while ((numBytesRead = ais.read(audioByte)) != -1) {
                             // Calculate the number of frames actually read.
                             numFramesRead = numBytesRead / bytesPerFrame;
                             totalFramesRead += numFramesRead;
                             return(result= true);
                   } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
                   ais.close();
                   throw ex;}
              } catch (Exception ex) {
                   JOptionPane.showMessageDialog(desk, " Error Loading File" ,"Error",
                             JOptionPane.WARNING_MESSAGE);
              return result;
         }

    You can find oracle documentation for sqlldr (11g) here:
    http://docs.oracle.com/cd/B28359_01/server.111/b28319/ldr_concepts.htm#SUTIL003
    If you have questions on details you should post your question in the special sqlldr forum:
    Export/Import/SQL Loader & External Tables
    hm

  • Loading XML file data

    Hello
    I am using Spry.Widget.AutoSuggest to sort the data from an
    external XML file
    In the XML there are some url-s pointing to pictures to be
    loaded but the problem is that they all loads in the cache as the
    page initializes.
    Although they are not shown at the begining i can see them
    caching ( firebug for mozilla)
    Is there any way to load the appropriate pictures (data) just
    after it matches the AutoSuggest search criteria.
    the example files are :
    http://www.evtinobg.com/newWebSite/_search.php
    http://www.evtinobg.com/newWebSite/models.xml
    thanx a lot

    Please read the FAQ thread and posting guidelines... Also please see the XML DB basic demo.. And try forum search, this question (or variant's of it) have been asked and answered so many times that it's really not worth starting (another) new thread on this issue.
    Edited by: mdrake on Jan 19, 2011 10:33 AM

  • How to load xml file data

    hi ,
    I know how to load data from csv file...
    Anyone can guide me for how to load data from xml file
    i need step by step guidence
    from
    naman

    hi naman shah,
    you can used XML DOM in SAP in order to read data from xml file
    first step to do that, you need to read the xml file using OPEN DATASET
    after that you convert the content of the file to XML DOM class in SAP using function modul SDIXML_XML_TO_DOM
    after that you can read / manipulate the data from xml.
    for the XML DOM class documentation in SAP, please refer to http://help.sap.com/saphelp_crm50/helpdata/en/bb/576637dca511d4990b00508b6b8b11/frameset.htm
    hopes it helps
    regards
    eddhie

  • Load XML Document/Data into relational Table

    Hi All,
    I have a requirement to load data in an XML file into an oracle db and subsequently split the contents into columns in an oracle table. This has to be done on the command line from a unix box which connects to a remote oracle DB.
    Can some one give me a step by step procedure to do this or point me in the right direction.
    thank you

    Hi,
    There can be many different way we can achieve this. Mainly depending on size of XML, complexity of XML and your use of that data (e.g. you just want to insert XML into relational or you want to write something and the generate new xmls later on).
    If you go to Oracle online documentation -> Oracle XML DB Developer's guide, first 3-4 chapters will give you what you need.
    Regards

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • Loading XML File in Oracle Tables through Concurrent Request

    I am posting a working program which reads an XML File and loads in Oracle database table through Concurrent Request. Input parameter for this program is file name. I have added directory name ASPEN_DIR as /interface/inbound in ALL_DIRECTORIES table.
    /* This is a sample program reading an input xml file and loads data in Oracle Database table
    This program is executed through concurrent request and it has an input file name
    it also creates a log for reading and inserting records from file and into a table
    CREATE OR REPLACE PACKAGE BODY CBAP_ACCRUENT_XML_PKG AS
    PROCEDURE read_emp_xml_file (errbuf out varchar2,
    retcode out number,
    in_filename in varchar2)
    is
    my_dir varchar2(10) := 'ASPEN_DIR';
    l_bfile BFILE;
    l_clob CLOB;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    l_nl dbms_xmldom.DOMNodeList;
    l_n dbms_xmldom.DOMNode;
    l_temp VARCHAR2(1000);
    v_empno number(10);
    v_ename varchar2(50);
    v_job varchar2(30);
    v_mgr number(10);
    v_hiredate date;
    v_sal number(10);
    v_comm number(10);
    src_csid NUMBER := NLS_CHARSET_ID('UTF8');
    v_read NUMBER(5);
    v_insert NUMBER(5);
    dest_offset INTEGER := 1;
    src_offset INTEGER := 1;
    lang_context INTEGER := dbms_lob.default_lang_ctx;
    warning INTEGER;
    BEGIN
    v_read := 0;
    v_insert := 0;
    l_bfile := BFileName(my_dir, in_filename);
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
    dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile), dest_offset,src_offset, src_csid, lang_context, warning);
    dbms_lob.close(l_bfile);
    -- make sure implicit date conversions are performed correctly
    dbms_session.set_nls('NLS_DATE_FORMAT','''DD/MM/RR HH24:MI:SS''');
    -- Create a parser.
    l_parser := dbms_xmlparser.newParser;
    -- Parse the document and create a new DOM document.
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    -- Free resources associated with the CLOB and Parser now they are no longer needed.
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    -- Get a list of all the nodes in the document using the XPATH syntax.
    l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/EMPLOYEES/EMP');
    -- Loop through the list and create a new record in a tble collection
    -- for each record.
    FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP
    l_n := dbms_xmldom.item(l_nl, cur_emp);
    v_read := v_read + 1;
    -- Use XPATH syntax to assign values to he elements of the collection.
    dbms_xslprocessor.valueOf(l_n,'EMPNO/text()',v_empno);
    dbms_xslprocessor.valueOf(l_n,'ENAME/text()',v_ename);
    dbms_xslprocessor.valueOf(l_n,'JOB/text()',v_job);
    dbms_xslprocessor.valueOf(l_n,'MGR/text()',v_mgr);
    dbms_xslprocessor.valueOf(l_n,'HIREDATE/text()',v_hiredate);
    dbms_xslprocessor.valueOf(l_n,'SAL/text()',v_sal);
    dbms_xslprocessor.valueOf(l_n,'COMM/text()',v_comm);
    insert into emp(empno,ename,job,mgr,hiredate,sal,comm)
    values(v_empno,v_ename,v_job,v_mgr,v_hiredate,v_sal,v_comm);
    v_insert := v_insert + 1;
    END LOOP;
    -- Free any resources associated with the document now it
    -- is no longer needed.
    dbms_xmldom.freeDocument(l_doc);
    --remove file to another directory
    commit;
    fnd_file.put_line(fnd_file.LOG,'Number of Records Read : '||v_read);
    fnd_file.put_line(fnd_file.LOG,'Number of Records Insert : '||v_insert);
    EXCEPTION
    WHEN OTHERS THEN
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    dbms_xmldom.freeDocument(l_doc);
    retcode := sqlcode;
    ERRBUF := sqlerrm;
    ROLLBACK;
    END read_emp_xml_file;
    END;
    <?xml version="1.0" ?>
    - <EMPLOYEES>
    - <EMP>
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7902</MGR>
    <HIREDATE>17-DEC-80</HIREDATE>
    <SAL>800</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7499</EMPNO>
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <MGR>7698</MGR>
    <HIREDATE>20-FEB-81</HIREDATE>
    <SAL>1600</SAL>
    <COMM>300</COMM>
    </EMP>
    - <EMP>
    <EMPNO>7521</EMPNO>
    <ENAME>WARD</ENAME>
    <JOB>SALESMAN</JOB>
    <MGR>7698</MGR>
    <HIREDATE>22-FEB-81</HIREDATE>
    <SAL>1250</SAL>
    <COMM>500</COMM>
    </EMP>
    - <EMP>
    <EMPNO>7566</EMPNO>
    <ENAME>JONES</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>02-APR-81</HIREDATE>
    <SAL>2975</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7654</EMPNO>
    <ENAME>MARTIN</ENAME>
    <JOB>SALESMAN</JOB>
    <MGR>7698</MGR>
    <HIREDATE>28-SEP-81</HIREDATE>
    <SAL>1250</SAL>
    <COMM>1400</COMM>
    </EMP>
    - <EMP>
    <EMPNO>7698</EMPNO>
    <ENAME>BLAKE</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>01-MAY-81</HIREDATE>
    <SAL>2850</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7782</EMPNO>
    <ENAME>CLARK</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>09-JUN-81</HIREDATE>
    <SAL>2450</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7788</EMPNO>
    <ENAME>SCOTT</ENAME>
    <JOB>ANALYST</JOB>
    <MGR>7566</MGR>
    <HIREDATE>19-APR-87</HIREDATE>
    <SAL>3000</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7839</EMPNO>
    <ENAME>KING</ENAME>
    <JOB>PRESIDENT</JOB>
    <HIREDATE>17-NOV-81</HIREDATE>
    <SAL>5000</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7844</EMPNO>
    <ENAME>TURNER</ENAME>
    <JOB>SALESMAN</JOB>
    <MGR>7698</MGR>
    <HIREDATE>08-SEP-81</HIREDATE>
    <SAL>1500</SAL>
    <COMM>0</COMM>
    </EMP>
    - <EMP>
    <EMPNO>7876</EMPNO>
    <ENAME>ADAMS</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7788</MGR>
    <HIREDATE>23-MAY-87</HIREDATE>
    <SAL>1100</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7900</EMPNO>
    <ENAME>JAMES</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7698</MGR>
    <HIREDATE>03-DEC-81</HIREDATE>
    <SAL>950</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7902</EMPNO>
    <ENAME>FORD</ENAME>
    <JOB>ANALYST</JOB>
    <MGR>7566</MGR>
    <HIREDATE>03-DEC-81</HIREDATE>
    <SAL>3000</SAL>
    </EMP>
    - <EMP>
    <EMPNO>7934</EMPNO>
    <ENAME>MILLER</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7782</MGR>
    <HIREDATE>23-JAN-82</HIREDATE>
    <SAL>1300</SAL>
    </EMP>
    </EMPLOYEES>

    http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10790/toc.htm
    Take a look at Examples 4-8 and 4-9. Even thought this is 10g doc code should work on 9.2.4 or later

Maybe you are looking for