xdmp:get-current-user() as xs:string?
Returns the name of the current user.
xdmp:get-current-user(); => "ian"