Help needed in shell script

i am trying to read an existing xml file and find an element in the xml file of following format
<home.dir value="/local/mnt/homes/docs"/>
I am trying to take a command line argument to my shell script whose value should replace /local/mnt/homes/docs in xml document.
Can you please point me how to acheive this. Appreciate your input

Please post the existing code you have written to solve this problem (wrapped in CODE tags) and annotate what you are doing with that code.

Thanks.

Hi Neo
I have not completed my code...heres what i am trying to do


#!/bin/bash
sed -i 's/local/mnt/homes/docs/$1/g' /home/viswas/test.xml

Try:

sed -i "s|/local/mnt/homes/docs|$1|g" /home/viswas/test.xml