Thanks for ur code man , its working here.
One more question would like to know ...
Is there a way that you can load the DTD into memory and use some code to validate whether the XML document created follows the DTD structure?
Can you give me your email address, will keep in touch with you.
You can reach me at email@example.com