Increment xml files with bash

view story

http://unix.stackexchange.com – A good mate on a forum had helped me with creating this script but everything Ive thrown at it outputs wrong and I do not know why or what is the issue. I ran all my script in ubuntu's terminal if questioned as bash test.sh. My goal is to increment several .xml file's process></process> tags, but some files could have 1 to 100 tags. Example: - jfksaJDFH - <process>value=""</process> - <process>value=""</process> - <process>value=""</process> - <process>value=""</process> - jdhkjasdh - <process>value=""</process> (HowTos)