title: Access all children of a certain node with simplexml and php
body: <p>I have a question and the answer is sure simple, but it just lacks of understanding from my side.</p>
  
  <p>I have a xml file with following look (short example)</p>
  
  <pre><code>&lt;item id="1234"&gt;
      &lt;property name="country_id"&gt;
          &lt;value&gt;4402&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="rc_maintenance_other"&gt;
      &lt;/property&gt;
      &lt;property name="claim_right_shareholder"&gt;
      &lt;/property&gt;
      &lt;property name="charges_other"&gt;
      &lt;/property&gt;
      &lt;property name="other_expenses_heating"&gt;
      &lt;/property&gt;
      &lt;property name="unpaid_bills_amount"&gt;
      &lt;/property&gt;
      &lt;property name="iv_person_phone"&gt;
          &lt;value&gt;03-6756711&lt;/value&gt;
      &lt;/property&gt;
  &lt;/item&gt;
  &lt;item id="9876"&gt;
     ...
  &lt;/item&gt;
  </code></pre>
  
  <p>My problem is, I want to read all propertys from the one item with the id 1234 with their attribute and their value, if exists, in an array.</p>
  
  <p>I know how to access the certain Item with xpath. (Thanks to this wonderful stackoverflow community :) )</p>
  
  <p>But how can I use the children() function only to a certain item?</p>
  
  <p>Like this</p>
  
  <pre><code>foreach ($item[id="1234"]-&gt;children() as $property) {
  </code></pre>
  
  <p>Thank you so much!</p>