title: Add Child Elements With the Same Name Using Simple XML
body: <pre><code>//create a simple xml object
  $xml = new SimpleXMLElement('some valid xml');
  
  //add a my_elements node
  $xml-&gt;addChild('my_elements');
  
  //an array of elements that will be added to to my_elments
  $my_elements = array('element_1', 'element_2', 'element_3');
  
  foreach($my_elements as $element){
     //my_element is only added once as shown below
     $xml-&gt;my_elements-&gt;addChild('my_element');
  
     $xml-&gt;my_elements-&gt;my_element-&gt;addChild('something', $element);
  }
  </code></pre>
  
  <p>What I would like this to look like is something like this(shown in xml for ease of reading)</p>
  
  <pre><code>&lt;xml&gt;
     &lt;my_elements&gt;
        &lt;my_element&gt;
            &lt;something&gt;element_1&lt;/something&gt;
        &lt;/my_element&gt;
        &lt;my_element&gt;
            &lt;something&gt;element_2&lt;/something&gt;
        &lt;/my_element&gt;
        &lt;my_element&gt;
            &lt;something&gt;element_3&lt;/something&gt;
        &lt;/my_element&gt;
     &lt;/my_elements&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>But what I am getting is something more like this</p>
  
  <pre><code>&lt;xml&gt;
     &lt;my_elements&gt;
        &lt;my_element&gt;
           &lt;something&gt;element_1&lt;/something&gt;
           &lt;something&gt;element_2&lt;/something&gt;
           &lt;something&gt;element_3&lt;/something&gt;
        &lt;/my_element&gt;
     &lt;/my_elements&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>Is it possible to make a separate child node when using addChild with the same name?</p>