It's the problem with Oracle 11g, Oracle 10g does not create any problem.
The problem is getObject of XML Type data in oracle 11g returns oracle.sql.OPAQUE instead of oracle.sql.XMLType and our setter method takes XMLType.
If I test it in a plain environment like Eclipse and my project points to M2_REPO, then getObject of XML Type returns oracle.xdb.XMLType but when I deploy in JBOSS and run the code snippet and it returns oracle.sql.OPAQUE.
oracle-xdb.jar deployed in WEB-INF/lib. What could be the problem.