This is the XInclude module, which is used with the modular documents CPF application.
To use the XInclude module as part of your own XQuery module, include the following line in your XQuery prolog:
import module namespace xinc = "http://marklogic.com/xinclude" at "/MarkLogic/xinclude/xinclude.xqy";
The library namespace prefix xinc is not predefined in the server.
xinc
xquery version "1.0-ml"; import module namespace xinc = "http://marklogic.com/xinclude" at "/MarkLogic/xinclude/xinclude.xqy"; declare namespace xi="http://www.w3.org/2001/XInclude"; let $root := fn:doc("http://example.org/mydoc.xml") return xinc:link-expand( $root, $root/section[1]/xi:include[1] )
xquery version "1.0-ml"; import module namespace xinc = "http://marklogic.com/xinclude" at "/MarkLogic/xinclude/xinclude.xqy"; xinc:link-references(fn:doc("http://example.org/mydoc.xml"))
xquery version "1.0-ml"; import module namespace xinc = "http://marklogic.com/xinclude" at "/MarkLogic/xinclude/xinclude.xqy"; xinc:node-expand( fn:doc("http://example.org/mydoc.xml") )