Oracle: udpate a XML value in place with sql

Oracle sql provides a simple way to update values in a xml document by sql.
The “updatexml” function can udpate any fields in by xpath.

update SCOTT.DEMO" d
set
myval=updatexml(d.myval,'/myroot/mynode/mytime/text()',to_char(sysdate,'YYYY-MM-DD"T"HH24:Mi:SS.FF3"Z"'))
where id=1234;

to update multiple values at once:

udpatexml(xmltype,xpath1,rep1,xpath2,rep2,...)

Very handy to update large documents.