I am looking to generate documentation from the system module stubs in etc/modules.zip. I have two issues
1) There is an issue with inspect.xqm declare namespace xqdoc="http://www.xqdoc.org/1.0"; let $a:=inspect:xqdoc("inspect.xqm")//xqdoc:function[xqdoc:name='inspect:xqdoc']//xqdoc:description return parse-xml-fragment($a) Errors And xqdoc:description looks like <xqdoc:description xmlns:xqdoc="http://www.xqdoc.org/1.0"></code> and end with <code></code> , and tags start with <code>@</code> . xqDoc comments can be specified for main and library modules and variable and function declarations. <p>We have slightly extended the xqDoc conventions to do justice to the current status of XQuery (Schema: <a href=" http://files.basex.org/etc/xqdoc-1.1.30052013.xsd ">xqdoc-1.1.30052013.xsd</a>): </p> <ul> <li> an <code>&lt;xqdoc:annotations/&gt;</code> node is added to each variable or function that uses annotations. The xqdoc:annotation child nodes may have additional <code>xqdoc:literal</code> elements with <code>type</code> attributes (xs:string, xs:integer, xs:decimal, xs:double) and values. </li> <li> a single <code>&lt;xqdoc:namespaces/&gt;</code> node is added to the root element, which summarizes all prefixes and namespace URIs used or declared in the module. </li> <li> name and type elements are added to variables </li> </ul></xqdoc:description> A comment parsing/escaping issue? 2) inspect:xqdoc("array.xqm") and the same with map.xqm Function 'array:size' is in reserved namespace. I guess this is to be expected and maybe I should just ignore any modules in namespaces http://www.w3.org/... I guess it is a result of the code being compiled rather than just documented? /Andy