I want to get the value of name and put it in a variable using XMLLint
echo \'cat //body
You need to use fn:string(), which will return the value of its argument as xs:string. In case its argument is an attribute, it will therefore return the attribute's value as xs:string.
xs:string
test=$(xmllint --xpath "string(//body/value/@name)" test.xml)