Try this, it's not beautiful but it works :)
I just erase lines containing > from stdout , cut the string to get the second part after the = , and delete "
test=$(echo 'cat //body/value/@name' | xmllint --shell "test.xml" | grep -v ">" | cut -f 2 -d "=" | tr -d \");
echo $test