title: Generating XML files
body: <p>i am trying to generate xml files that contain the information that i have inserted in the console of the application. it contain title information and a image gallery, i am having problem with listing the image gallery pictures. everything else is generated correctly but when i try to populate the information of the image gallery it dont work. this is a copy of the problem, please advice and i am still a beginner and this might be a stupid mistake but please a need help.</p>
  
  <pre><code>function array2XML($anews)
      {   
  
          $images = $this-&gt;selectAllImages($anews);
  
  
          $_xml = "       &lt;tag path=\"".wk_show($anews['FileLink'])."\"&gt;\n"
                 ."           &lt;title&gt;".wk_show($anews['Title'])."&lt;/title&gt;\n"
                 ."           &lt;dateT&gt;".wk_show($anews['Date'])."&lt;/dateT&gt;\n"
                 ."           &lt;desc&gt;".wk_show($anews['Content'])."&lt;/desc&gt;\n"
                 ."           &lt;photos pathTh=\"admin/images/news/thumbs/\" pathPr=\"admin/images/news/preview/\"&gt;\n";
  
  // here is the problem when i remove it it works but it only take 1 image of the gallery
                  foreach($images as $image)
                      {   
                      echo "i am in the loop &lt;br /&gt;";
  
                          $_xml ="           &lt;tag path=\"".wk_show($image['FileLink'])."\"/&gt;\n";
                      }
                 $_xml ="           &lt;/photos&gt;\n" 
                 ."       &lt;/tag&gt;\n";
  
          $_xml = preg_replace(array("/\&amp;([a-z\d\#]+)\;/i", "/\&amp;/", "/\#\|\|([a-z\d\#]+)\|\|\#/i", "/(\=\"\-\/\%\?\!\'\(\)\[\\{\}\ \#\+\,\@_])/e"),
                               array("#||\\1||#", "&amp;", "&amp;\\1;", "'&amp;#'.ord('\\1').';'"),
                               $_xml);
  
          $_xml = ereg_replace (" &amp; ", " &amp;amp; ", $_xml);
  
          return $_xml;
      }
  </code></pre>