I know this question is a few months old now, but a method that can work within ant that does what you need to do. It will use the fetch-all, but you can then pull the exact XOMs that you want. If you need more XOMs, you add more variables to it (e.g. TARGETXOM1, TARGETXOM2). This was included as a sample within the z/OS product on 8.7 and a white paper I helped write cover this:
<target name="fetch-xom">
<mkdir dir="${HBRWORKPATH}" />
<res-fetch-all hostname="${FETCHHOSTNAME}"
destfile="${HBRWORKPATH}/${HBRFILE}"
portnumber="${FETCHPORT}" webapp="res"
userid="${FETCHUSERID}" password="${FETCHPASSWORD}">
</res-fetch-all>
<unzip src="${HBRWORKPATH}/${HBRFILE}" dest="${HBRWORKPATH}">
<patternset>
<include name="${TARGETXOM}_${XOMVERSION}.zip" />
</patternset> </unzip>
</target>
<!-- Step Two: Get the ruleapp from the repository -->
<target name="fetch-ruleapp">
<res-fetch hostname="${FETCHHOSTNAME}"
destfile="${HBRWORKPATH}/${TARGETRULEAPP}.jar"
portnumber="${FETCHPORT}"
userid="${FETCHUSERID}"
password="${FETCHPASSWORD}"
ruleapp="${TARGETRULEAPP}"
version="${TARGETRULEAPPVERSION}" />
</target>
<!-- Step Three: Deploy the ruleapp and XOM that was retrieved -->
<target name="deploywithxom">
<res-deploy hostname="${DEPLOYHOSTNAME}" portnumber="${DEPLOYPORT}"
webapp="${DEPLOYWEBAPP}" userid="${DEPLOYUSERID}" password="${DEPLOYPASSWORD}" file="${HBRWORKPATH}/${TARGETRULEAPP}.jar">
<xompath rulesetpath="/${TARGETRULEAPP}/${TARGETRULESET}"> <fileset dir="${HBRWORKPATH}">
<patternset>
<include name="${TARGETXOM}_${XOMVERSION}.zip" />
</patternset> </fileset>
</xompath> </res-deploy>
<!--Deploy the XOM to the Target Rule Execution Server -->
<res-deploy-xom hostname="${DEPLOYHOSTNAME}"
portnumber="${DEPLOYPORT}" webapp="${DEPLOYWEBAPP}"
userid="${DEPLOYUSERID}" password="${DEPLOYPASSWORD}"
outputRulesetProperty="ruleset.managed.uris">
<xompath>
<fileset dir="${HBRWORKPATH}">
<patternset>
<include name="${TARGETXOM}_${XOMVERSION}.zip" />
</patternset> </fileset>
</xompath>
</res-deploy-xom>
Let me know if you have questions!