As you correctly noticed at least the repeating block could re-factoredbe refactored.
For example, declare the following Xsl template for rendering Budget:
<xsl:template name="RenderBudget">
<xsl:param name="CostCenter"/>
<xsl:choose>
<xsl:when test="$CostCenter = ''">
<span>0</span>
<br/>
<span style="font-size:8px;color:red">No budget assigned!</span>
</xsl:when>
<xsl:otherwise>
<span style="padding-left:20px;color:black;font-weight:bold;font-size:12px;">
<xsl:value-of select="format-number($CostCenter,'0.0')"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and then invoke it
<xsl:call-template name="RenderBudget">
<xsl:with-param name="CostCenter" select="/dsQueryResponse/Rows/Row[@Job_x0020_Title = $fieldvalue and substring-after(@Test_x0020_Cost_x0020_Center.,'#') = $jobvalue]/@Test_x0020_Cost_x0020_Center_x002"/>
</xsl:call-template>
Note:the code has not been tested