sed -e '/username/s/CDATA[name]/CDATA[something]/' -e '/password/s/CDATA[password]/CDATA[somethingelse]/' -e '/dbname/s/CDATA[name]/CDATA[somethingdifferent]/' file.txt