anchor.diff:  %% Error Conditions
   %%    [file:no-dir] is raised if $path does not point to an existing directory.
   %%    [file:io-error] is raised if any other error occurs.
  -children(Ctx,Dir) ->
  -   list(Ctx,Dir,?bool(false),?str(<<"*">>)).
  +children(_, Dir) when is_binary(Dir) ->
  +   case filelib:is_dir(Dir) of
  +      false -> err_no_dir(Dir);
  +      true ->
  +         try
  +            Rep = fun(Li) ->
  +                        maybe_add_dir_sep(
  +                          filename:nativename(Li))
  +                  end,
  +            [Rep(Li) || Li <- file_wildcard(<<"*">>, Dir)]
  +         catch
  +            _:_ ->
  +               err_io_error(Dir)
  +         end
  +   end;
  +children(Ctx, Dir) ->
  +   children(Ctx, xqerl_types:cast_as(Dir, 'xs:string')).
   
   %% 5.4 file:path-to-native
   %% Signature
  
positive.code:          case file:pread(Fd, Offset, Length) of
              eof ->
                 _ = file:close(Fd),
                 err_out_of_range(File);
              {ok,Bin} ->
                 _ = file:close(Fd),
                 ?bin(Bin);
  
negative.code:    Path = filenameify(Path0),
     case file:open(Path, [append,binary,{encoding,Enc}]) of
        {ok,Fd} ->
           try
              % not a fan of this, but it is like this in the test-suite
              % BOM for every append...
              if Enc == utf16 -> ok = io:put_chars(Fd, [16#FEFF]);
                 true -> ok
              end,
              ok = io:put_chars(Fd, Value),
              []
           catch
              _:_ ->
                 err_io_error(Path)
           after
               _ = file:close(Fd)
           end;
        {error,eisdir} ->
           err_is_dir(Path);
  