Hello @all, on Oracle 12.2.0.1: I need a query as follows: SELECT XMLSERIALIZE(CONTENT t.po AS varchar2(1000) INDENT SIZE=2) inhalt, XMLCAST(XMLQUERY('count(//itemNo)' PASSING po RETURNING CONTENT) AS NUMBER) cntItems1, XMLCAST(XMLQUERY('count(/purchaseOrder/itemNo)' PASSING po RETURNING CONTENT) AS NUMBER) cntItems2 FROM ( SELECT XMLPARSE(CONTENT ' 1 2 3 ' WELLFORMED ) AS PO FROM DUAL) t WHERE --XMLEXISTS('/purchaseOrder/*[count(itemNo)>0]' PASSING po) --don't work XMLEXISTS('//*[count(itemNo)>2]' PASSING po) ---work The problem is as follows: I don't get any rows if i use the first xmlexists() in the where clause, whereas the second works! The difference is only th xpath expression. But both xpath expressions works in xmlquery() in the select list! So my question is: Why the first xpath in xmlexists() don't work? By the way: I get an ORA-21500 (internal error) [%s],[%s],[%s],[%s],[%s],[%s], with the following stmt: SELECT XMLPARSE(CONTENT '' ) FROM DUAL whereas this runs: SELECT XMLPARSE(CONTENT '' WELLFORMED) FROM DUAL WELLFORMED is an optional parameter! Thanks for your support! Maik