I just committed a few improvements that will be of interest to all
those making heavy use of xupdate update/replace/remove operations or
their XQuery equivalents: removing/replacing a larger node tree from a
document used to be very slow. I redesigned the code today, which
leads to a real boost in performance. Giulio (who reported the issue)
saw a speed up in his application from 70 seconds to 320 ms (for
replacing a large, deep structured section within a document).