To complement this: In a straightforward implementation, the following query…
declare function local:f() { 123 }; inspect:serialize(map {}), inspect:serialize(local:f#0), inspect:serialize(substring#2), inspect:serialize(function() {1})
…would yield the following result:
map { } function() as item()* { local:f() } function($string_0 as xs:string?, $start_1 as xs:double) as xs:string { fn:substring($string_0, $start_1) } function() as xs:integer { 1 }