Thank you for your suggestions. But i'm afraid i cannot use the modules suggested as there is a limitation on tool which further processes this code.For security reasons i am unable to reveal tool name.Hence simple PERL code is the solution. Thanks for your understanding
So your input file (and apparently also your output file) are XML, but you can't use standard Perl XML modules to process your data. I can't say I understand all this, but it seems as if your security situation is such that you cannot say anything that would help clarify your circumstances. That's the way it is sometimes. You have my sympathy.