For 100K records or more the above code didnt work on my machine.. ( i had kept JVM Heap size to Max. 1300K.. )
The reason was the XMLConverter was not able to convert that much data into XML So i wrote the code to divide all the ArrayLists in chunks and then convert them and write them into the same file..
FileWriter fw = new FileWriter(new File("foo.xml

, true);
the flag in the constructor is for Appending the new data to same file..
and so file can be generated without any trouble..
Best Regards