title: Collect all the values of an attribute existed in a balise into one
body: <p>I have an xml file define as following :</p>
  
  <pre><code>  &lt;test&gt;
      &lt;years year ="2001"&gt;
    &lt;/test&gt;
    &lt;test&gt;
      &lt;years year ="2002"&gt;
    &lt;/test&gt;
    &lt;test&gt;
      &lt;years year ="20013"&gt;
     &lt;/test&gt;
  </code></pre>
  
  <p>How to get all attributes existed in a file xml , and add it into it ? Something like that :</p>
  
  <pre><code>&lt;test&gt;
    &lt;years&gt;2001,2002,2003&lt;/years&gt;
    &lt;/test&gt;
    &lt;test&gt;
      &lt;years year ="2001"&gt;
    &lt;/test&gt;
    &lt;test&gt;
      &lt;years year ="2002"&gt;
    &lt;/test&gt;
    &lt;test&gt;
      &lt;years year ="2003"&gt;
     &lt;/test&gt;
  </code></pre>
  
  <p>Many thanks in advance </p>