Figured it out - the fix is in the demo\xmfo\xsl\fo\commons.xsl file, not the task-elements.xsl file. In the commons.xsl file, for the
<xsl:template match="*[contains(@class, ' task/stepresult ')]">
<fo:block xsl:use-attribute-sets="stepresult" id="{@id}" >
<xsl:apply-templates/>
</fo:block>
</xsl:template>
change "block" to "inline" in both instances.
<xsl:template match="*[contains(@class, ' task/stepresult ')]">
<fo:inline xsl:use-attribute-sets="stepresult" id="{@id}" >
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
This will keep the <stepresult> on the same line as the preceding element (which may or may not be the <cmd>, but that's not always what the <stepresult> follows, so this is a better fix).
RP