title: Handling array like variable with XSLT
body: <p>I have declared a variable in my XSLT as given below :</p>
  
  <pre><code>    &lt;xsl:variable name="inline-array"&gt;
      &lt;Item&gt;A&lt;/Item&gt;
      &lt;Item&gt;B&lt;/Item&gt;
      &lt;Item&gt;C&lt;/Item&gt;
  &lt;/xsl:variable&gt;
  </code></pre>
  
  <p>I am accessing this variable as given below :</p>
  
  <pre><code>&lt;xsl:param name="array"
      select="document('')/*/xsl:variable[@name='inline-array']/*" /&gt;
  &lt;xsl:value-of select="$array[1]" /&gt;
  </code></pre>
  
  <p>This is working fine as long as my inline array has static contents. But my requirement is to dynamically assign values in the XSLT to the tag "Item" ie. Something like :</p>
  
  <pre><code>&lt;xsl:variable name="inline-array"&gt;
      &lt;Item&gt;$item1&lt;/Item&gt;
      &lt;Item&gt;$item2&lt;/Item&gt;
      &lt;Item&gt;$item3&lt;/Item&gt;
  &lt;/xsl:variable&gt;
  </code></pre>
  
  <p>But, I tried all possible options without any luck. Any suggestions will be greatly appreciated. Any other options to fulfill my requirement is also welcome. Thanks. </p>