title: How to retrieve 2D array from xml string resource for Android?
body: <p>Suppose I have stored a 2 dimensional array in android resource as shown below. How can I get them in a java collection like Arraylist?</p>
  
  <pre><code>&lt;resources&gt;
  &lt;string-array name="countries_array"&gt;   
  &lt;item&gt;
      &lt;name&gt;Bahrain&lt;/name&gt;
      &lt;code&gt;12345&lt;/code&gt;
  &lt;/item&gt;
  &lt;item&gt;
      &lt;name&gt;Bangladesh&lt;/name&gt;
      &lt;code&gt;54545&lt;/code&gt;
    &lt;/item&gt;
  &lt;item&gt;
      &lt;name&gt;India&lt;/name&gt;
      &lt;code&gt;54455&lt;/code&gt;
  &lt;/item&gt;
  
  &lt;/string-array&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>For example in case of 1 dimensional array we can do it using </p>
  
  <pre><code>getResources().getStringArray(R.array.countries_array);
  </code></pre>
  
  <p>When the countries_array is like</p>
  
  <pre><code>&lt;resources&gt;
  &lt;string-array name="countries_array"&gt;   
    &lt;item&gt;Bahrain&lt;/item&gt;
    &lt;item&gt;Bangladesh&lt;/item&gt;
    &lt;item&gt;India&lt;/item&gt;
  &lt;/string-array&gt;
  &lt;/resources&gt;
  </code></pre>