Anil,
Have a look on the
Oracle technet website where you can find the XML SQL Utility for
Java. This utility helps generating XML Documents from SQL queries.
You may also code your stored procedure in Java to access the Java classes that come with the Oracle XDK.
Cheers