Dear Team , I am following the below steps to execute my XQuery 1) I am Created collection with the MyFile.xml 2) I am running the query which is in attached file(query.txt) on the above collection 3) I am Grouping the C4 element for Grouping 4)I am running this query in java Java code : new XQuery(query).execute(context,fileoutstream); Query running properly when I am not using the group by clause Problem : If I use the group by ,exception is coming like out of main memory,can you please tell me Is their any alternate to reduce the memory when using group by Thanks & Regards Chandra Sekhar -- This message is for the intended recipient only. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of the information is strictly prohibited. __