I am creating an module to hold commonly used XQuery expressions as functions. $doc defines the document in my collection of TEI files, and the following returns a date of birth in the desired way:

<div id="sidebar" class="span-6">
<h3><b>{$fullname}</b></h3>

let $dob := $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth
return <p>{$dob/text()}</p>
</div>


Next, I move this code to a function in a module in the namespace bibl.  The above div becomes:

<div id="sidebar" class="span-6">
<h3><b>{$fullname}</b></h3>

{ bibl:dob($doc) }
</div>


The function is declared in the bibl.xqm module thus:

declare function bibl:dob($doc) {
let $dob := $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth
            return <p>{$dob/text()}</p>
};


This arrangement does not return the date of birth to the resulting web page.  Does anyone see where the error is here?  I have assumed the $doc argument will be passed from the main page to the function in the bibl module.  'bibl' is imported into the main page and seems to be defined correctly as a module.

Thanks,
Chris