The main problem is this xsl:if statement
<xsl:if test="//attributes//attribute[(attributeName = 'salience')]">
At this point, the context is still the root node, so all this does is checking the existing of an attibute element, you are not actually positioning yourself on the node. Thus, when you do the xsl:value-of you are simply getting the first value in the XML.
Instead of using an xsl:if, you should probably try matching the attribute element, like so
<xsl:apply-templates select="attributes/attribute[attributeName = 'salience']"/>
The whole XSLT would be as follows
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates select="attributes/attribute[attributeName = 'salience']"/>
</xsl:template>
<xsl:template match="attribute">
<xsl:element name="{attributeName}">
<xsl:value-of select="value"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
When applied on your input XML, the output is as follows:
<salience>73</salience>
Note the use of xsl:element
<xsl:element name="{attributeName}">
This avoids having to hard-code salience in your matching template, making it more generic should you wish to match other elements in a similar fashion.