I cannot use XML parser.. because it too huge and not accepting by the design.
For each pic X(400000) message. we have to unstring 80 tags like this and will process around 200- 300 message in each run.
This is complete and utter GARBAGE! I've got XML PARSE programs that run on input variables of 10 MILLION bytes -- twenty-five times larger than yours. And there is absolutely no problem with using XML PARSE on that much data. And I extract over 2000 records, each with about 20 separate XML tags, from that data.
So if you don't want to do the work to make XML PARSE function, say so -- since it IS a good bit of work -- but don't blame the system for YOUR shortcomings. And if the endings are different -- </aaaa>, </bbbb>, </CCCC?> or whatever -- then you will not be able to use UNSTRING. You will need to use reference modification, which I would consider to take more work and be slower than using XML PARSE anyway.