i have a xmltype table with an object type/atrribute of datatype CLOB. When i now do a query i get the error ORA-22835 - what's going wrong? The datatype of the source attribute and the declared variable is CLOB.

In my understanding, the error comes from the combination of the xdb:SQLType="CLOB" annotation and xs:base64binary datatype declaration. They're incompatible.

Within XML DB, xs:base64binary is natively mapped to SQL binary type, that is RAW or BLOB.
So I would change all the annotations to xdb:SQLType="*BLOB*", or, if you want to keep a CLOB attribute, then define the elements as "xs:string".

The advantage of annotating xs:base64binary with xdb:SQLType="BLOB" is that the conversion will be done automatically from base64 to BLOB when the file is loaded.

However,

You'll hit another issue when trying to query the BLOB with XQuery-based functions XMLTable or XMLQuery :

you are the best :)
Thanks a lot, it's working as you described:
>
The advantage of annotating xs:base64binary with xdb:SQLType="BLOB" is that the conversion will be done automatically from base64 to BLOB when the file is loaded.
>