title: Mathematica : Write matrix-data to XML ; Read matrix-data from XML
body: <p>( Part of ) a matrix representation of the objects I work with is the following:</p>
  <pre><code> {
   {1, A,{100,  20, 30},10},
   {2, B,{100}, 0},
   {3, X,{120,20},0},
   {4, C,{},11}
   }
  </code></pre>
  <p>I want to store this data externally in XML Format as follows</p>
  <p>&lt;data&gt;<br>
  &lt;row key=&quot;1&quot; val1=&quot;A&quot; val2=&quot;10&quot;&gt; &lt;occ&gt;100&lt;/occ&gt;&lt;occ&gt;20&lt;/occ&gt;&lt;occ&gt;30&lt;/occ&gt;&lt;/row&gt;<br>
  &lt;row key=&quot;2&quot; val1=&quot;B&quot; val2=&quot;0&quot;&gt;&lt;occ&gt;100&lt;/occ&gt;&lt;/row&gt;<br>
  &lt;row key=&quot;3&quot; val1=&quot;X&quot; val2=&quot;0&quot;&gt;&lt;occ&gt;120&lt;/occ&gt;&lt;occ&gt;20&lt;/occ&gt;&lt;/row&gt;<br>
  &lt;row key=&quot;4&quot; val1=&quot;C&quot; val2=&quot;11&quot;&gt;&lt;/row&gt;<br>
  &lt;/data&gt;</p>
  <p>I am looking for an example on how to:</p>
  <h3>-  transfer the the matrix to XML ( which Mathematica commands ? )</h3>
  <h3>-  parse the XML string back to matrix format after having imported the XML file.</h3>