XQuery update

Hello,
I seems that the CVS version of XQuilla implements a large part of the XQuery Update working draft, which is great !
Does it mean that it's usable with BDB XML as-is to get database updates ?
Thanks,
Fabrice

Hi Fabrice,
I'm afraid there is significant work to do in DB XML before XQuery Update can be used from it. However, It is our intention to support XQuery Update in some future version.
John

Similar Messages

  • Xml Validation & XQuery Update

    Hello,
    I have a question on xml validation in Berkeley DB XML (2.5.16).
    I read in documentation that an xml can be validated against an xml DTD or Schema when is loaded into a container. However, when an XQuery Update is to be executed is there any configuration that allows checking if the XQuery Update leads to an xml that does not conform with the DTD/Schema? If so, how this case is managed? The XQuery is executed, or not? Is there any exception thrown?
    I made a test over this: I wrote an xml (and a related DTD) where an element contains an id attribute and another element a referencing attribute to the aforementioned id. Then, an XQuery Update 'delete' expression deletes the element with the id attribute. The element is indeed deleted, the xml is left in an inconsistent state and I am allowed of making more update operations to this document...
    I was wondering if there is any way of handling this case, except from being careful with what updates you choose, so that the xml is kept in a valid state. Is there something I am missing?
    thank you in advance,
    theo

    Hello,
    I believe that XQuery execution does not support DTD yet. I'll investigate further and let you know what else I can find.
    Thanks,
    Sandra

  • Use of XQuery Update Facility

    Dear all,
    I am looking for some database systems that use the W3C XQuery Update facility specification to modify their data.
    To the best of my knowledge, no of well-known commercial database systems uses XQuery Update primitives.
    For instance, Oracle 11g defines some SQL/XML update functions (combined with some XQuery expressions) to modify XML data stored within the database through the XMLType data type.
    IBM DB2 9 uses SQL update statement to modify the whole XML document stored as an XML column and no update is proposed to modify parts of the document.
    Are there some database systems providing XQuery-Update-Facility-based update of their data.
    Thank you in advance.
    Best regards.

    Were you aware of
    [url http://www.liberidu.com/blog/2011/09/22/oracle-xmldb-xquery-update-in-database-release-11-2-0-3-0/]Oracle XMLDB XQuery Update in Database Release 11.2.0.3.0
    Given it is new, expect a few bugs, such as
    {thread:id=2355054}
    If you have specific questions related to XQuery Update, the best place to ask them is over in the {forum:id=34} forum.

  • XML DML XQuery Update syntax

    Hi everybody,
    Certainly my question will appear strange and even stupid , but I want to be sure to use the best syntax and also to be confirmed about some points.
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?
    In page 15, the SQL statement to modify XML document uses deletexml, not a XQuery update syntax.
    I'm using Oracle 11G.
    Thanks in advance for your explanations

    user4423142 wrote:
    In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?The recommended way is closely tied to the version you're using, which you didn't give.
    "11g" is not a version, it's a product name.
    You can find the version by running :
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    XQuery Update on Oracle in available in the latest version only : 11.2.0.3.
    If you're using this version, Oracle recommends you start using XQuery Update.
    Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
    I think copy is not specific to Oracle, is it used in XQuery language ?<tt>copy</tt> is specific to the XQuery Update Facility (XQUF) extension of the XQuery 1.0 language.
    The XQUF was primarily intended to work with native XML databases where it's OK to directly invoke update primitives (insert, delete, replace etc.) to modify database content.
    On Oracle, it's not possible and the current implementation only supports XQUF through the "transform" operation (copy/modify syntax) where a copy of the original document/fragment is modified and written back to the db.
    However, XQuery rewrite and related optimizations may occur so that piecewise updates actually take place.

  • XQuery Update implementation

    Hello,
    is it possible to get prerelease of the next version of DBXML or at least the documentation focused on XQuery Update implementation.
    Thanks
    Mario

    Mario,
    2.4 will be generally available quite soon. The Getting Started Guides in the documentation have sections on basic XQuery Update usage (replacing the old sections on XmlModify). The candidate recommendation is a detailed (if not user-friendly) source of information:
    http://www.w3.org/TR/xquery-update-10/
    Regards,
    George

  • Xquery update transaction (xqilla)

    Hi,
    it seems that when performing an xquery update such as 'insert node' that a transaction is allocated for this query, so that (using the Java API) there is no need to explicitly create a transaction - is this true?
    If it is, then just using xquery gets rid of a transaction management problem and the try/finally.
    thanks,
    Norman

    An updating query is auto-transacted if a transaction is not provided. However, auto-transacted methods still need to catch deadlock exceptions and retry.
    John

  • XQuery Update Facility

    I see on the Wikipedia article for XQuery Update Facility, that XQilla, which BDBXML uses, implements the XQUF (not sure to which degree though). Can you utilize these commands in any XQuery, and does it require a special use of the API? Any documentation on your site? This looks like a very exciting language extension to have available.
    thank you,
    Brett

    Brett,
    Thanks. This also means XmlModify will eventually disappear since it's no longer
    necessary (and now implemented in terms of XQuery Update anyway). It's still around for
    now.
    As for security, we're considering one or both of:
    1. bool XmlQueryExpression::isUpdateExpression() to allow the application
    to ask the question and decide.
    2. A flag (e.g. DBXML_NO_UPDATES) passed to the relevant execute() and query() functions. In Java it'd be a new configuration option in XmlDocumentConfig
    Do you have a preference? I'm leaning toward (1) -- it's a slightly simpler change
    and just as easy to use.
    Regards,
    George

  • XQuery Update Facility in XMLDB?

    Hi
    I didn't find information about XQuery Update Facility
    support or XUpdate support in Oracle XML DB. Do you have
    such info?
    Regards,
    --drkm                                                                                                                                                                                                                                                                                                                           

    Xquery update is NOT anywhere near well enougth defined for us to implement it at present. We are actively involved in the standards process for XQuery update. It's very unclear what the future of the XUpdate is at this point...
    We support node-level updates through a set of SQL functions
    updateXML (9iR2 and later), insertChildXML, appendChildXML, insertXMLBefore and deleteXML (10gr2 and later)
    Message was edited by:
    mdrake

  • Decreasing performance when executing consecutive XQuery Update operations

    hello,
    I am writing an application in java using Berkeley DB XML (2.5.16). I have to run a test over the application, in which a lot of XQuery Update operations have to be executed. All update operations are insert statements. In the beginning the test works fine. However, as the number of updates increases (over 1000 XQuery Updates), there is also a great increase in time of execution. How can I enhance the performance of updates?
    Note that:
    1) The environment configuration is the following:
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(true);
    envConfig.setInitializeCache(true);
    envConfig.setCacheSize(512*1024*1024);
    envConfig.setInitializeLocking(false);
    envConfig.setInitializeLogging(false);
    envConfig.setTransactional(false);
    2) No transactions are used
    3) The container is a node container
    4) Auto-indexing is on (I need that)
    5) The container includes only one xml of 2,5MB size.
    6) In some insert statements 1000 nodes are to be inserted.
    7) I am running windows vista on a 4GB Ram pc.
    Thank you in advance,
    theo

    Hi Lucas,
    Thanks a lot for your reply! However, I have a few more questions.
    Given that the xml is about 2.5MB size, is it considered to be that big for Berkeley DB so it needs to be break down into smaller documents?
    Also, after having executed ~4000 xquery update insert operations and doubled xml’s size, the performance it’s really getting worse… An insertion may even take 1.5 min, when for each of the first 3000 insertions only less than 0.5 sec is needed… Is there something I am missing in the configuration of Berkeley DB? If I set autoindexing off and try to maintain fewer indexes, is it possible to see significantly better performance? Till now I am just getting the following error when I set my indexes and try to execute consequent insertions over the same node:
    Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: Sequence does not match type item() - the sequence does not contain items [err:XUDY0027], <query>:1:1, errcode = QUERY_EVALUATION_ERROR+
    at com.sleepycat.dbxml.dbxml_javaJNI.XmlQueryExpression_execute__SWIG_1(Native Method)
    at com.sleepycat.dbxml.XmlQueryExpression.execute(XmlQueryExpression.java:85)
    +<myClasses>+
    Thanks,
    theo

  • XQuery Update (11.2.0.3) and the path table

    Hi,
    I'm currently using XQuery update on 11.2.0.3 to merge 2 XML documents, having tried a number of approaches up to now on 11.2.0.2.
    My table has one XMLType column (securefile binary containing unstructured xml) which has XML deltas applied to it via a stored procedure.
    An unstructured XML index is defined on the column.
    Previously, I was doing the following:
    1) Merge documents using XMLQuery; only produce a merged document if changes were detected
    2) Update the table if the merged document is non-null
    i.e.
    select XMLQuery(<merging code>) passing oldDoc as "oldDoc", delta as "delta" returning content) into mergedDoc from dual;
    if (mergedDoc is not null) then
        update myTable set xmlDoc = mergedDoc where id=v_id;
    end if;However, this replaces the entire document if any changes are detected (with an obvious impact on the path table).
    I then read (UpdateXML query rewrite with unstructured data? about the use of XQuery Update in 11.2.0.3 to only target the affected document fragments so my current approach is:
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, delta as "delta"
            returning content)
    where id = v_id;If no changes were detected between the documents (i.e. the XQuery update did not actually modify the document), would you expect this statement to have no impact on the path table? Is there any way to get more trace information which shows what the update is actually doing when it executes?
    Apologies if this is overlong or if I have omitted any supplementary information.
    Thanks for any assistance
    Larry

    Hi,
    many thanks for your reply.
    A simple testcase is below. The recursive approach is required because the documents may be hierarchial.
    create table mytable (id number(19,0), xmldoc xmltype) xmltype column "XMLDOC" store as securefile binary xml;
    insert into myTable values (1,xmltype('<xml><el1>1</el1><el2>2</el2><el3>3</el3></xml>'));
    update myTable
    set xmldoc =
            xmlquery('declare namespace m="http://www.blah.com/merge";
            (: See if two nodes have matching text (or no text which is an empty sequence :)
            declare function m:matchText($one as element(), $two as element()) as xs:boolean {
                if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
            declare updating function m:merge($old as element()?, $new as element()?) {
                (for $o in $old/* return
                    for $n in $new/* where name($o) = name($n) return
                        if (count($n/*) > 0) then
                            m:merge($o, $n)
                        else
                            if (m:matchText($n, $o)) then () else replace value of node $o with $n,
                    for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
            copy $d := .
            modify (
                (m:merge($d/*,$delta/*))
            ) return $d'
            passing xmldoc, xmltype('<xml><el1>1-UPDATE</el1><el4>4</el4></xml>') as "delta"
            returning content)
    where id = 1;This results in one update and one insert:
    <xml><el1>1-UPDATE</el1><el2>2</el2><el3>3</el3><el4>4</el4></xml>It currently produces the following trace:
    *** 2012-03-13 10:13:34.708
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    UDF with noderef
    --------- XQuery NO rewrt expr END-----I've noticed that even with a simple XQuery update like the following:
    update myTable set xmldoc =
            xmlquery('copy $d := .
            modify (
                (replace value of node $d/xml/el1 with "1-UPDATE-2",insert node <el4>4</el4> into $d/xml)
            ) return $d'
            passing xmldoc
            returning content) where id = 1;I get the following trace:
    *** 2012-03-13 10:31:42.280
    --------- XQuery NO rewrt expr BEG-----
    non-simple content in target expression
    --------- XQuery NO rewrt expr END-----
    --------- XQuery NO rewrt expr BEG-----
    not delete/insert/replace in modify clause
    --------- XQuery NO rewrt expr END-----
    Non-iterator usage
    Non-iterator usageDoes this also indicate that a rewrite is not occurring, or is this only when a message like "NO REWRITE Reason ==> xseq:not optuop" is traced?
    I'll try XSLT in the meantime.
    Regards
    Larry

  • PutDocument and XQuery update in the same txn

    Hey all!
    Is it a good idea to use putDocument() and then insert nodes into another document in the same transaction? The only thread I have hangs on XmlQueryExpression qe = xmlManager->prepare(...). If it's not a good idea, can I somehow perform those two actions atomically?
    Many thanks
    Vyacheslav

    Hi Vyacheslav,
    That's completely fine. My suspicion is that you aren't using the transaction for the call to XmlManager::prepare(), which is then creating a new transaction under the covers. Using more than one transaction in a single thread is a really bad idea, and can lead to the kind of hangs you describe.
    John

  • Devicename not updated in Profilemanager - SecCertificateCopyCommonName() failed

    I have successfully enrolled serveral iPhones 3GS/4/4S (all running iOS 5.0.1) on my Lion-Server 10.7.2.
    One iPhone3GS still makes problem, cause the name of the iPhone is still shown as a new device in Profilemanager. The logfile shows:
    [CertsRequestHandler(HelperAdditions) commonNameForCertificate:]: SecCertificateCopyCommonName() failed: -25304
    Dec 25 14:49:56: --- last message repeated 3 times ---
    I have already restore the settings, set it up as a new device, still no change....
    Any further hints?
    best regards Uwe

    I made some slight modifications to the code, built on Windows x64 and created the container (renamed it to MyContainer.dbxml - added the file extension) and added the document.
    Then I opened the container using the dbxml shell and used an XQuery Update statement to try and replace the value. The query I used:
    dbxml>query "replace node doc('dbxml:/MyContainer.dbxml/MyDoc1')/__/Password with <Password><![CDATA[newPass]]></Password>"
    This gave me the following result:
    <__><![CDATA[server_1]]><type><![CDATA[Server_1]]></type><Password>newPass</Password></__>
    It looks like if you want to replace data in the CDATA sections you're going to have to replace the entire document. From what I can tell (and until someone on the product team can confirm or correct me on this), it appears to be a bug.
    Hope this helps,
    Lucas
    Edited by: Lucas Vogel on Oct 14, 2012 2:51 PM

  • Update statement problem !!

    Hi,
    I need some specific features for my school project and BDB is almost providing me with this functionality. In my project, I want to provide the user with the functionality to provide the update statements from the user screen. I want to then take the user input in a java variable for manipulation of the xml data and display the end result. The only option I have for the user is to provide the xquery updates with the following syntax: ( I need this syntax for update statements as I use a parser to convert the user input to involve fuzziness):
    "insert nodes &lt;b4&gt;inserted child&lt;/b4&gt; after doc('dbxml:/test.dbxml/book)/Bookstore";
    Now I am trying to run these with the below Code but I am not actually getting the required output. Can somebody help me to debug or fix this code for my requirement. I use the following xml data :
    &lt;Bookstore&gt;
    &lt;Book&gt;
    &lt;book_ID&gt;1&lt;/book_ID&gt;
    &lt;title&gt;Harry Potter and the Order of the Phoenix&lt;/title&gt;
    &lt;subtitle/&gt;
    &lt;author&gt;
    &lt;author_fname&gt;J.K.&lt;/author_fname&gt;
    &lt;author_lname&gt;Rowling&lt;/author_lname&gt;
    &lt;/author&gt;
    &lt;price&gt;9.99&lt;;;/price&gt;
    &lt;year_published&gt;2004&lt;/year_published&gt;
    &lt;publisher&gt;Scholastic, Inc.&lt;/publisher&gt;
    &lt;genre&gt;Fiction&lt;/genre&gt;
    &lt;quantity_in_stock&gt;28997&lt;/quantity_in_stock&gt;
    &lt;popularity&gt;20564&lt;/popularity&gt;
    &lt;/Book&gt;
    &lt;/Bookstore&gt;
    I have track points in my code to find the mistake and I get the following ouput.
    Track 3
    Track 3.1
    Track 3.2-----
    The code I use fails to compile the xquery statement with .prepare API.
    import java.io.*;
    import com.sleepycat.db.*;
    import com.sleepycat.dbxml.*;
    public class phone{
    public static void main(String[] args)
    String document1 = "C:/Documents and Settings/cjmadall/Desktop/BDB/book.xml";
    String docName = "book";
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    try {
    myManager = new XmlManager();
    myContainer = myManager.openContainer("test.dbxml");
    String myQuery = "insert nodes &lt;b4&gt;inserted child&lt;/b4&gt; after doc('dbxml:/test.dbxml/book)/Bookstore";
    // This Works and displays the entire document-&gt; String myQuery = "collection('test.dbxml')";
    // This Doesnt Work, ends with the above output -&gt; String myQuery = "insert nodes &lt;newNode&gt;Some new text&lt;/newNode&gt; after collection("dbxml:/test.dbxml")/Bookstore";
    // collection('test.dbxml')/Bookstore";
    System.out.println("Track 3 ");
    XmlQueryContext managerContext = myManager.createQueryContext();
    System.out.println("Track 3.1 ");
    // Get a context for the document queries
    // XmlQueryContext documentContext = myManager.createQueryContext();
    System.out.println("Track 3.2 ");
    // Prepare the XmlManager query
    *XmlQueryExpression managerQuery = myManager.prepare(myQuery, managerContext);*
    System.out.println("Track 3.3 ");
    // Perform the query.
    XmlResults results = managerQuery.execute(managerContext, 0);
    // Display the result set
    System.out.println("Track 3.4 ");
    XmlValue value;
    while ((value = results.next()) != null){
    System.out.println(value.asString());
    System.out.println("Track 3.5 ");
    results.delete();
    managerQuery.delete();
    // documentContext.delete();
    managerContext.delete();
    } catch (XmlException e) {
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here
    }//end finally
    Thanks.

    I was using a old version of BDB and the latest version fixed this issue.

  • XQuery Modify cannot be compiled

    Hi Gurus. Oracle EE 11.2 running on Linux. SQL Dev 3.2.30.09.
    I am fairly decent with XPath and XSLT but am new to XQuery. I've implemented a few simple FLOWRs but I am getting a bit more complex. I have an XQuery where I am trying to replace some data inline. I have pared the actual XML and the code down to a very simple example that still returns the same error.
    The error:
    ORA-19112: error raised during evaluation: XQuery Update connot be compiled
    19112. 00000 -  "error raised during evaluation: %s"
    *Cause:    The error function was called during evaluation of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    Error at Line: 7 Column: 14
    My Xquery:
    SELECT XMLQuery(
      'copy $tmp := $xmldata
           modify (replace value of node $tmp/MSG_CNTNT_XML/Message/msgHdr/Source/Format/text() with "abc")
         return $tmp'
         PASSING msg_cntnt_xml as "xmldata"
         RETURNING CONTENT ) xmlmct
    FROM (SELECT xmltype('<Message>
       <msgHdr>
          <Source>
             <Format>CTS</Format>
          </Source>
       </msgHdr>
    </Message>') msg_cntnt_xml
           FROM DUAL)
    Any general tips for XQuery and modify is cool but what I am really looking for is why am I getting the "Update connot be compiled". (BTW, notice the spelling error, connot - I'm not judging).
    Any tips for debugging or being able to display intermediate results would be awesome also.
    Thanks.
    LewisC

    Hi Lewis,
    What's your exact database version?
    You're trying to use XQuery Update Facility (a small extension to XQuery 1.0) which is only available from 11.2.0.3 and onwards.
    On previous versions, you can use updateXML() function :
    SQL> SELECT updateXML(
      2           msg_cntnt_xml
      3         , '/Message/msgHdr/Source/Format/text()'
      4         , 'abc'
      5         ) xmlmct
      6  FROM (SELECT xmltype('<Message>
      7     <msgHdr>
      8        <Source>
      9           <Format>CTS</Format>
    10        </Source>
    11     </msgHdr>
    12  </Message>') msg_cntnt_xml
    13         FROM DUAL)
    14  ;
    XMLMCT
    <Message><msgHdr><Source><Format>abc</Format></Source></msgHdr></Message>

  • Re:XML update

    Hello Gurus ,
    i want to write a procedure for xml update ,
    consider,
    a table department consisting depart_no,depart_name,emp_Personal_info here emp_personal_info is a column of xmltype
    having data like (for a single department)(FOR DEPTNO 5801)
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982</date_of_birth>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
      </EMPPERSONALINFO>
    </EMP>a each department is holding information of over 100 employees(up to <id>100</id>)
    now i want to update emppersonal info with a new attribute <mainbranch>with a default data based on department number
    required output:
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982'</date_of_birth>
        <mainbranch>CZDS</MAINBRANCH>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
      <mainbranch>CZDS</MAINBRANCH>
      </EMPPERSONALINFO>
    </EMP>kindly guide me,
    regards,
    friend

    Hi,
    What's the database version?
    You've posted enough here to know how to properly ask a question.
    now i want to update emppersonal info with a new attribute <mainbranch>with a default data based on department numberYou wouldn't have such issue if the data model was correctly designed in the first place, using 3rd NF, i.e. with a separate child table to hold employee information.
    You can use insertchildXML or appendChildXML functions :
    SQL> update department t
      2  set t.emp_personal_info =
      3      insertchildxml(
      4        t.emp_personal_info
      5      , '/EMP/EMPPERSONALINFO'
      6      , 'mainbranch'
      7      , xmlelement("mainbranch", 'D' || t.dept_no)
      8      )
      9  where t.dept_no = 5801 ;
    1 row updated
    SQL> set long 5000
    SQL> select xmlserialize(document emp_personal_info indent) from department;
    XMLSERIALIZE(DOCUMENTEMP_PERSO
    <EMP>
      <EMPPERSONALINFO>
        <id>1</id>
        <name>x1</name>
        <join_date>12/2/2013</join_date>
        <work_station_no>LYH043897</work_station_no>
        <date_of_birth>2/2/1982</date_of_birth>
        <mainbranch>D5801</mainbranch>
      </EMPPERSONALINFO>
      <EMPPERSONALINFO>
        <id>2</id>
        <name>x2</name>
        <join_date>2/5/2013</join_date>
        <work_station_no>LYH043898</work_station_no>
        <date_of_birth>30/5/1982</date_of_birth>
        <mainbranch>D5801</mainbranch>
      </EMPPERSONALINFO>
    </EMP>
    These XML DML functions are deprecated as of 11.2.0.3 in favor of XQuery Update.

Maybe you are looking for