I want to edit the config file of a program that is an XML:
...
Most people would probably use sed to do line editing from a bash script. If you actually care about parsing the XML, then use something like Perl which has a ready XML parser.