title: how to read particular nodes from xml file using php
body: <p>Here is the structure of the XML file am trying to fetch...</p>
  
  <pre><code>&lt;feed&gt;
      &lt;entry&gt;
          &lt;id&gt;1347030&lt;/id&gt;
          &lt;title&gt;abcd&lt;/title&gt;
          &lt;description&gt;xyz&lt;/description&gt;
          &lt;brand&gt;mnop&lt;/brand&gt;
          &lt;link&gt;http://www.abcd.com/1.html&lt;/link&gt;
          &lt;image_link&gt;http://www.abcd.com/1.jpg&lt;/image_link&gt;
       &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>This is a small snippet of the XML...the file is huge...so am using XMLReader</p>
  
  <p>I want to fetch the </p>
  
  <blockquote>
    <p>image_link</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>link</p>
  </blockquote>
  
  <p>nodes from this XML feed. To achieve this I have done the following code.</p>
  
  <pre><code>$xmlDocument = "test.xml";
  $xml = new XMLReader();
  $xml-&gt;open($xmlDocument);
  while( $xml-&gt;read() ) {
  if($xml-&gt;name == "image_link") {
      echo $xml-&gt;link ."&lt;br/&gt;";
    echo "&lt;a href='".$xml-&gt;link."'&gt;&lt;img height='80' width='100' src=" .$xml-&gt;readInnerXML()."&gt;&lt;/a&gt;&lt;br /&gt;";
  $xml-&gt;next();
  }
  }
  </code></pre>
  
  <p>This returns me the image but the link node is not fetched....any suggestion how to do this</p>