Odd, one can see <R> but not access by it. Run this:
declare function local:K($x){
switch ($x)
case 2 return <R><name>N</name><o><name>Y</name></o></R>
default return()
};
"
A",local:K(2)//*:R,
"
B",local:K(2)/o/name, (: shows we are already at the root :) "
C",local:K(2)/., (: reveals R is really in there, but can't be called by name :) "
D",local:K(2)/./R
What's the deal?