title: How to parse text and image from complex xml
body: <p>I hope you can help me with that. The XML file looks like this:</p>
  
  <pre><code>&lt;channel&gt;&lt;item&gt;
  &lt;description&gt;
  &lt;div&gt;  &lt;a href="http://image.com"&gt;
  &lt;span&gt;   
  &lt;img src="http://image.com" /&gt; 
  &lt;/span&gt;
  &lt;/a&gt;
  Lorem Ipsum is simply dummy text of the printing etc... 
  &lt;/div&gt;
  &lt;/description&gt;
  &lt;/item&gt;&lt;/channel&gt;
  </code></pre>
  
  <p>I can get the contents of the description tag, but when i do that, i get the whole structure which has lots of css in there and i don't want that.
  What i really need is to parse the href link and the Lorem Ipsum text only. I'm trying with simple XML, but can't find out, looks too complicated. Any ideas?</p>
  
  <p><strong>edit:</strong>
  code i use to parse xml</p>
  
  <pre><code>$file = new SimpleXMLElement($mydata);
  {
  
      foreach($file-&gt;channel-&gt;item as $post)
  {
  
      echo $post-&gt;description; } }
  </code></pre>