We cannot mix updating and non updating instructions in the same list, so instruction sequences like this are not allowed : ( db:add(any document from disk), for ... in ... return .... )
True, this is not allowed by the XQuery Update specification (and our own extensions must follow those rules as well). For now, you'll have to resort to several single XQuery expressions to get the requested results.
Hope this helps, Christian