How to create key value pair inside XSLT and get value using key
<p>Inside XSLT I have state which is coming from XML and on corresponding to that state I have my own state code which I want to put in transformed XML. </p>

<p>Source XML:</p>

<pre><code>&lt;states&gt;
&lt;state&gt;New York&lt;/state&gt;
&lt;state&gt;California&lt;/state&gt;
&lt;/states&gt;
</code></pre>

<p>Expected Result:</p>

<pre><code>&lt;states&gt;
    &lt;state&gt;NY&lt;/state&gt;
    &lt;state&gt;CA&lt;/state&gt;
&lt;/states&gt;
</code></pre>

<p>As I have list of states so I can't use <strong>when</strong> or <strong>If</strong> statement so Is their  any optimized way to solve this problem in XSLT 1.0 or 2.0? Thanks in advance.</p>