SSH problem

Hi ,
I have this piece of code.

 
for xyz in `grep "$envir $envtype" ~/user/Move/config/ProdEnvList|cut -d "|" -f11`
do
username=`cat ~/user/Move/config/ProdEnvList|grep $xyz|cut -d "|" -f7`
hostname=`cat ~/user/Move/config/ProdEnvList|grep $xyz|cut -d "|" -f6`
ssh $username@$hostname -n 'cd $xyz;find . -type f|grep MVCConfig.xml' >> list
done

But the thing is that after my ssh, the value of $xyz is lost.
How can pass this value to other server to which i am doing ssh?

Switch those single quotes in the ssh command to double quotes.

You would need to export the variable. Check the link