Dimitre による答えは、あなたの場合の最も速い解決策のようです。しかし、あなたが尋ねたので、ここにXProcの代替案があります:
<p:declare-step version="1.0" xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" exclude-inline-prefixes="#all" name="main">
<!-- create context for p:variable with base-uri pointing to the location of this file -->
<p:input port="source"><p:inline><x/></p:inline></p:input>
<!-- any params passed in from outside get passed through to p:xslt automatically! -->
<p:input port="parameters" kind="parameter"/>
<!-- configuration options for steering input and output -->
<p:option name="input-dir" select="'./'"/>
<p:option name="input-filter" select="'^report_.*\.xml$'"/>
<p:option name="output-dir" select="'./'"/>
<!-- resolve any path to base uri of this file, to make sure they are absolute -->
<p:variable name="abs-input-dir" select="resolve-uri($input-dir, base-uri(/))"/>
<p:variable name="abs-output-dir" select="resolve-uri($output-dir, base-uri(/))"/>
<!-- first step: get list of all files in input-dir -->
<p:directory-list>
<p:with-option name="path" select="$abs-input-dir"/>
</p:directory-list>
<!-- iterate over each file to load it -->
<p:for-each>
<p:iteration-source select="//c:file[matches(@name, $input-filter)]"/>
<p:load>
<p:with-option name="href" select="resolve-uri(/c:file/@name, $abs-input-dir)"/>
</p:load>
</p:for-each>
<!-- wrap all files in a reports element to be able to hand it in to the xslt as a single input document -->
<p:wrap-sequence wrapper="reports"/>
<!-- apply the xslt (stylesheet is loaded below) -->
<p:xslt>
<p:input port="stylesheet">
<p:pipe step="style" port="result"/>
</p:input>
</p:xslt>
<!-- store the result in the output dir -->
<p:store>
<p:with-option name="href" select="resolve-uri('merged-reports.xml', $abs-output-dir)"/>
</p:store>
<!-- loading of the stylesheet.. -->
<p:load href="process-reports.xsl" name="style"/>
</p:declare-step>
たとえば、上記を process-reports.xpl として保存します。XMLCalabash (http://xmlcalabash.com/download/) で実行できます。次のように実行できます。
java -jar calabash.jar process-reports.xpl input-dir=./ output-dir=./
上記のコードは、すべてのレポートをラップする 1 つのドキュメントを取得し、それに対して少し処理を行う process-reports.xsl を想定しています。純粋な XProc で処理を行うこともできますが、この方法を好むかもしれません。
p:xslt ステップを p:for-each 内 (p:load の下) に移動することもできます。これにより、xslt が各レポートに個別に適用されます。
幸運を!