Thanks for your reply.
I have solved the problem almost like the way William Brogden has said.
1. At first I have taken the xml file and done a "find and replace operation" to all the "></" places with "a long special text" that must not occur in the xml file using apache common io.
2. Then I did my usual task and got the output file.
3. Then I did find and replace operation again upon both input and output file. This time I only replaced my "a long special text" with an empty
string.
That's it.
Regards.
>