The presence of --profiledir and --profile suggests to me that the teitoX tools were designed to allow customization by users. That is, someone could create a new profile for their own project and get teitodocx, for instance, to use this new profile. This profile could contain a customized to.xsl.
I've been doing just that with one of my projects. It so happens that I'd like to use base-uri() to compute the name of an auxiliary file. The details are not important but the general idea is for instance if I execute:
$ teitodocx --profiledir=wherever --profile=custom blah.xml
I'd like the to.xsl stylesheet in custom to compute the name blah.aux.xml from blah.xml and do something with it.
What I want to do does not appear straightforwardly doable right now. This is because the input file blah.xml is copied into a temporary directory as tmp2.xml. Consequently to.xsl has no access to the original file name. There is an inputDir parameter passed to to.xsl but no corresponding inputFile parameter.
In my case, I can work around the problem by having a processing step prior to invoking teitodocx which would effectively import blah.aux.xml into blah.xml. However, it is not clear to me that this solution will work in every case someone wants to.xsl to read data from a file other than the original input file.