I want to minimize the time.In that case, first get the fastest possible computer. The one you're using is not adequate. And make sure to configure it so that no other applications are competing for resources. And make sure you get the fastest possible disk drives, and make sure there is plenty of empty disk space. You may want to consider whether some other operating system will be faster in terms of writing to disk.
Is there any way to solve my issue ?It is yet to be shown that you even have an issue, and it is apparent that none of the articles you have read on the Internet is even valid: evidently none of them mentions an alternative, so they aren't comparing DOM to anything.
SELECT sys_XMLGen( dept_t(department_id, department_name, d.location_id, CAST(MULTISET(SELECT emp_t(e.employee_id, e.last_name, e.job_id, e.manager_id, e.hire_date, e.salary, e.commission_pct) FROM hr.employees e WHERE e.department_id = d.department_id) AS emplist_t))).getCLOBVal() AS deptxml FROM hr.departments d WHERE department_id = 10 OR department_id = 20;
while converting result set into XML format.
java.lang.OutOfMemoryError: Java heap space