parse nested xml into php
<p>Hi all i have an xml file e.g</p>

<pre><code>&lt;recipe&gt;
    &lt;id&gt;abc&lt;/id&gt;
    &lt;name&gt;abc&lt;/name&gt;
    &lt;instructions&gt;
        &lt;instruction&gt;
            &lt;id&gt;abc&lt;/id&gt;
            &lt;text&gt;abc&lt;/text&gt;
        &lt;/instruction&gt;
        &lt;instruction&gt;
            &lt;id&gt;abc2&lt;/id&gt;
            &lt;text&gt;abc2&lt;text&gt;
        &lt;instruction&gt;
    &lt;instructions&gt;
&lt;recipe&gt;
</code></pre>

<p>on my php file i use </p>

<pre><code>$url = "cafe.xml";
// get xml file contents
$xml = simplexml_load_file($url);

// loop begins
foreach($xml-&gt;recipe as $recipe)
{
code;
}
</code></pre>

<p>but it only retrieve the recipe id and name so how can i retrieve the instructions.</p>
