I'm using BaseX 9.1.1 on Linux.
So I need to go through a whole bunch of documents and emit them in an obfusticated form so the folks doing publication development can have them without the client's security people becoming upset.  I don't want to obfusticate the db contents; I just want to be able to write out an obfusticated version.
declare function local:gib($in as text()) as text() {
  text { 'ABCD' }
};
declare function local:obfusc($in as document-node()) as document-node() {
    copy $c := $in
    modify (
      for $x in $c/descendant::text()[normalize-space] 
      return replace node $x with local:gib($x)
    )
    return $c
};
for $doc in db:open('out')[contains(document-uri(),'/scr_')][1]
  let $blurred := local:obfusc($doc)
  return $blurred
If I run this, I get $doc back unaltered.  If I look at the optimized query, it looks like it ought to be changing things.
What am I doing wrong?
Thanks!
Graydon