title: php remove extra brackets from xml
body: <p>I need to parse a huge xml of photo albums. I'm using PHP SimpleXML to parse, however it fails on some entries with errors because extra brackets may appear in some cases, see 'description' or 'CameraModel' tags.</p>
  
  <p>How do I clean up xml before loading it with SimpleXML? If possible, replace extra brackets with '_' underscore.</p>
  
  <p>Here is my xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;values&gt;
  &lt;photos&gt;
  &lt;photo&gt;&lt;photoID&gt;4521&lt;/photoID&gt;
  &lt;name&gt;&lt;/name&gt;
  &lt;description&gt;Seattle&lt;3&lt;/description&gt;
  &lt;fileName&gt;S5001497.jpg&lt;/fileName&gt;
  &lt;fileSize&gt;177513&lt;/fileSize&gt;
  &lt;fileSizeOriginal&gt;2359669&lt;/fileSizeOriginal&gt;
  &lt;width&gt;1200&lt;/width&gt;
  &lt;height&gt;900&lt;/height&gt;
  &lt;exif&gt;&lt;CameraModel&gt;&lt;Digimax S500 / Kenox S500&lt;/CameraModel&gt;
  &lt;CameraMake&gt;Samsung Techwin&lt;/CameraMake&gt;
  &lt;DateTime&gt;2008-07-12 17:37:24&lt;/DateTime&gt;
  &lt;Version&gt;220&lt;/Version&gt;
  &lt;SourceWidth&gt;2592&lt;/SourceWidth&gt;
  &lt;SourceHeight&gt;1944&lt;/SourceHeight&gt;
  &lt;Orientation&gt;1&lt;/Orientation&gt;
  &lt;FlashUsed&gt;89&lt;/FlashUsed&gt;
  &lt;FocalLength&gt;5.8&lt;/FocalLength&gt;
  &lt;ExposureTime&gt;0.033333&lt;/ExposureTime&gt;
  &lt;Brightness&gt;&lt;/Brightness&gt;
  &lt;ApertureFNumber&gt;2.8&lt;/ApertureFNumber&gt;
  &lt;ISO&gt;177&lt;/ISO&gt;
  &lt;ExposureProgram&gt;0&lt;/ExposureProgram&gt;
  &lt;/exif&gt;
  &lt;type&gt;photo&lt;/type&gt;
  &lt;GPS&gt;&lt;/GPS&gt;
  &lt;/photo&gt;
  &lt;/photos&gt;
  &lt;/values&gt;
  </code></pre>