I am trying to run XQuery code, but variable in return expression is not being resolved
When I run the following XQuery code
for $x in (<Person/>,<Person/>)
return $x
I get the output
<Person/>
<Person/>
Which is fine, but when I run the following code
for $x in (<Person/>,<Person/>)
return <Name>$x</Name>
I get
<?xml version="1.0" encoding="UTF-8"?>
<Name>$x</Name>
<Name>$x</Name>
Why is the variable $x not resolved when enclosed inside an element in a return expression?