kranthi chamarthi wrote:Its like i make an api call, get output...
Oh no it isn't. And don't let any XML-phile tell you that it is.
For one thing: inside Java (and sometimes even outside) there is NO conversion involved. You simply transmit the data.
Strings are NOT "objects" (except in the broadest sense), and XML adds a whole new layer to the business of conversion - not the least being that it ALL has to be "well-formed".
What XML
does allow you to do (given all the above constraints, AND with the right encoding and parser) is to transmit
anything in context (IF that context is understood by the receiver). But the overheads are
huge.
However, getting back to your actual problem, it would appear that it has absolutely nothing to do with XML. You simply want a search and replace for "${something}" with "${something-else}", and that is dead easy
providing your XML file CANNOT contain any "${...}" strings that you DON'T want replaced.
Have a look at
String.replaceAll(), because I think you'll find that it covers everything you need.
And if not...c'mon back
Winston