anchor.diff:  cast_as( ?xav('xs:duration', Val), 'xs:yearMonthDuration' ) -> 
      Rec = Val#xsDateTime{day = 0, hour = 0, minute = 0},
      Str = xqerl_datetime:to_string(Rec,'xs:yearMonthDuration'),
  -   ?xav('xs:yearMonthDuration', Rec#xsDateTime{string_value = Str});
  +   ?xav('xs:yearMonthDuration', set_date_string(Rec, Str));
   cast_as( ?xav('xs:float', Val), 'xs:boolean' ) ->
      if Val == 0 -> ?false;
         Val == neg_zero -> ?false;
  
positive.code:                          name = #qname{} = Q1}) ->
     case xqldb_doc:node_kind(Doc, Node) of
        attribute ->
           {Ns,_,Ln} = xqldb_doc:node_name(Doc, Node),
           Q2 = #qname{namespace = fix_ns(Ns), local_name = Ln},
           has_name(Q2, Q1);
        _ ->
           false
     end;
  
negative.code:                          type = #xqSeqType{type = Type}}) ->
     case catch xqldb_doc:node_kind(Doc, Node) of
        element ->
           Q2 = node_qname(Node, Doc),
           case has_name(Q2, Q1) of
              true ->
                 EType = xqldb_doc:type_name(Doc, Node),
  