Я надеюсь, что это поможет (я использую Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production), и это нормально для меня:
Вот код, который вставит тег «Страницы»в нужном месте:
select INSERTCHILDXML(l_xml,
'/bookstore/book', 'Pages',
XMLType('<Pages>260</Pages>')) into l_xml
from dual;
А вот что внутри начала-конца:
/*from this part it is the same code as you have given us*/
declare
l_xml XMLTYPE;
l_clob CLOB;
begin
l_xml:=XMLTYPE('<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="web" cover="paperback">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>');
/*to this part it is the same code as you have given us*/
/*this is just one example how you can add <Pages> tag*/
select INSERTCHILDXML(l_xml,
'/bookstore/book', 'Pages',
XMLType('<Pages>260</Pages>')) into l_xml
from dual;
/*this part is so you can see what you did :)*/
select l_xml.getClobVal()
into l_clob from dual;
DBMS_OUTPUT.PUT_LINE(l_clob);
end;