Hello -- Using db:node-id() is an order of magnitude faster than using generate-id() to relate various nodes to their ancestors when constructing a composite id. This works great. Now I have a map (the keys are the value returned by db:node-id() for specific elements) and I want to update either a document or the db to have the new, calculated values as id attribute values. I expected that I could use for $thisDoc in db:get('ID-DB') ...calculate some stuff... ... $hasIDKey is the map:keys() of the map of calculated values... return $thisDoc update {(//*[db:node-id(.) = $hasIDKey]) ! (insert node attribute { 'id' } { $composedMap(./db:node-id(.))?composed } into .)} This pattern worked with generated-id() values; with db:node-id() the error I get is: [db:node] No database node: <publication.../>. (Publication is the expected document element.) db:node-id() worked in a function in a library module when $thisDoc was a parameter, so I'm at a bit of a loss; I would have expected that db:node-id() is the stable identifier and could work with updating expressions but perhaps that was optimism. Is there an appropriate way to relate a db:node-id() value to an element in an updating expression? Thanks! Graydon