G'day Gregory!
A bit slow to respond I'm sorry; you've probably moved on with this already. I don't have personal experience using Saxon's XSLT extension module, so I won't comment on the earlier discussion thread directly, but I did have a couple of other thoughts about using pipelines in XTF, which has been exercising my brain recently (especially the bit about the awkwardness of adding new steps to an XTF pipeline).
You should probably also consider the option of moving the DB integration out of XTF into a separate batch process, e.g. a bash script -- or an XProc script would be my personal preference -- that either uses the Saxon XSLT extensions which you've referred to, or else uses the command-line apps mysql or mysqldump to produce XML files, and then uses an XSLT to integrate the data from MySQL into each TEI file; effectively a script that takes your TEI corpus as input and outputs a copy which has been enhanced. I think there's some advantage to be had from not having your code entangled with any particular version of XTF, and also it may be easier just for debugging, or avoiding dependency issues such as e.g. being forced to use XTF's version of Saxon.
My other suggestion would be to treat the data integration process as a part of the TEI processing pipeline; i.e. that database integration should be a process that takes TEI as input and produces TEI as output (which then gets fed into the start of XTF's pipelines). From a logical perspective, it makes sense to think of the DB-enhancement of the TEI documents as something independent of your actual publication platform (i.e. some specific version of XTF), and instead to see it as a relational DB staging area for editing TEI metadata. The data in your bibliographic database "supporting" your TEI corpus should have obvious and direct mappings onto TEI metadata elements, so it should come fairly naturally to write your DB integration code so that it simply merges the relational data into the TEI documents, encoded with the appropriate TEI elements. Then you can hand off the resulting TEI corpus to the remainer of XTF's pipelines, and (to some extent, at least) rely on existing (or upcoming) features of XTF's indexing and display stylesheets to handle that markup.
A complication with this approach is that XTF's pipelines have a fixed set of steps, so it's not totally straightforward to add a "database enhancement" step to the start. I believe the simplest way to do it is to use the "pipelining" features that are built into XSLT itself, where you transform the input and capture the output of the transformation (a result tree) in a variable, and then apply-templates to that variable to transform it a second time (and you can obviously extend that pattern to an arbitrary number of pipeline steps). If you do this kind of pipeline in XSLT it's helpful to use the same @mode for all the templates in a particular stage of the pipeline, so that you avoid any confusion between templates belonging to different stages in the pipeline.
So if it were me, and doing it in XTF (using the Saxon XSLT extension), I would write the enhancement as a single XSLT "db-enhance.xsl" which would contain a bunch of templates all with @mode="enhance", and I'd integrate that with the preFilter and dynaXML pipelines by finding the "local override" stylesheet which is the first stage of that pipeline, and editing it to add:
<xsl:import href="../../db-enhance.xsl"/>
In that "db-enhance.xsl" you'd have a template which matched TEI docs only if they had not already been enhanced, e.g.
<!-- NB this is the template that effectively adds a stage to one of XTF's pipelines -->
<!-- Catch a TEI document which isn't enhanced. Enhance it first, and resubmit the enhanced version for further processing -->
<xsl:template match="tei:TEI[not(contains(@type, 'database-enhanced'))]">
<xsl:variable name="enhanced-tei-document>
<xsl:copy><!-- copy the TEI element and its attributes -->
<xsl:copy-of select="@*"/>
<!-- set a flag so that the apply-templates below would not be matched again by this rule -->
<xsl:attribute name="type">database-enhanced</xsl:attribute>
<!-- copy the TEI, inserting the DB data where appropriate -->
<xsl:apply-templates mode="enhance"/>
</xsl:copy>
</xsl:variable>
<!-- pass the enhanced document on to XTF's normal processing -->
<xsl:apply-templates select="$enhanced-tei-document"/>
</xsl:template>
<xsl:template match="*" mode="enhance"><!-- identity template to copy all elements that aren't being enhanced -->...
<!-- insert bibliography from DB -->
<xsl:template match="tei:sourceDesc" mode="enhance">
<xsl:copy><!-- copy existing sourceDesc -->
<xsl:copy-of select="@* | *"/>
<!-- insert bibliography from database -->
<listBibl>
<!-- make db calls to import relevant bibliographic citations -->
...
</listBibl>
</xsl:copy>
</xsl:template>
etc.
I hope you find that helpful in some way!
Conal