title: How to show image element from XML with php
body: <p>I've tried what others have posted on stack overflow but it doesn't seem to work for me. So could anyone help please.
  I have this xml document with a structure of:</p>
  <pre><code>&lt;surveys&gt;
  &lt;survey&gt;
  &lt;section&gt;
  &lt;page&gt;
  &lt;reference&gt;P1&lt;/reference&gt;
  &lt;image&gt;&lt;! [CDATA[&lt;img src=&quot;imagepath&quot;&gt;]]&gt;&lt;/image&gt;
  &lt;/page&gt;
  &lt;page&gt;
  &lt;reference&gt;P2&lt;/reference&gt;
  &lt;image&gt;&lt;! [CDATA[&lt;img src=&quot;imagepath&quot;&gt;]]&gt;&lt;/image&gt;
  &lt;/page&gt;
  &lt;/section&gt;
  &lt;/survey&gt;
  &lt;/surveys&gt;
  </code></pre>
  <p>Then this is my PHP code to get the image to show up:</p>
  <pre><code>function xml($survey){
  $result = &quot;&lt;surveys&gt;&lt;/surveys&gt;&quot;;
  $xml_surveys = new SimpleXMLExtended($result);
  $xml_survey = $xml_surveys-&gt;addChild('survey');
  if (&quot;&quot; != $survey[id]){
  $xml_survey_&gt;addChildData($survey['image']);
  }
  </code></pre>
  <p>This is my other file:</p>
  <pre><code> $image = “”;
  
   if(“” != $image){
          $image = &lt;div class=“image_holder”&gt; $image &lt;/div&gt; 
     echo $image;
  }
  
  </code></pre>
  <p>I'm not sure how to progress forward with this. so any help would be appreciated</p>