Hi all, Why does this xquery work: let $result := doc("document.xml")//*[properties] let $astypes := distinct-values(for $n in $result/ancestor-or-self::*[properties] return name($n)) return $astypes <> Whereas these xqueries don't: let $result := doc("document.xml")//properties/.. let $astypes := distinct-values(for $n in $result/ancestor-or-self::*[properties] return name($n)) return $astypes <> let $result := doc("document.xml")//properties/parent::* let $astypes := distinct-values(for $n in $result/ancestor-or-self::*[properties] return name($n)) return $astypes <> The latter two xqueries return an error: MAPI = monetdb@host:50000 QUERY = let $result := doc("document.xml")//properties/parent::* ERROR = !ERROR: ancestor-or-self: illegal data in size column or context list. !ERROR: PFll_ancestor_or_self: operation failed. Which MonetDB expert can explain? Regards, Hans v R