I am half way to accomplish it -- more help please
You guys were absolutely right about using an xml command-line parser. After I gave up with grep, I found a fantastic program, xmlstarlet, that simplifies incredibly the task of extracting the text I want.
Now, I have found the way to put the modified text back to the xml file, but I need some advice about accessing the other application that will process it. The other application runs on another machine, my server, so I have to find a way to pass the text there and have it back modified to my desktop pc. One more challenge is that the remote program loads huge amount of data in memory when it is called, so I need that data to stay in memory otherwise the processing of the text is very time consuming. I was advised to use netpipes, hose and faucet, to establish a client-server communication. However, I can't find much documentation about this.
Any ideas are most welcome.