Du kan sende variabler ind, bare definere dem i din passing-klausul:
with table1 AS
(select xmltype(
'<abc>
<def>
<contract>1</contract>
<oper>SFO</oper>
<lmt>limit1</lmt>
</def>
<def>
<contract>2</contract>
<oper>boston</oper>
<lmt >limit2</lmt>
</def>
</abc>'
) xmlcol from dual
)
SELECT u.*
FROM table1
, XMLTable('/abc/def[contract = $count]'
PASSING xmlcol, 1 as "count"
COLUMNS contract integer path 'contract',
oper VARCHAR2(20) PATH 'oper' ) u
CONTRACT OPER
---------- --------------------
1 SFO