title: JavaScript match and replace; what is the best way?
body: <p>So I've already got this working but I'm hoping someone can help me optimize it.</p>
  
  <p>I have a ton of XML data that I'm grabbing and do not have control over. One of the tags has markup in it and instead of using >, &lt; and " it uses the HTML names. I've setup a really simple function to return the string with the proper elements so that I can write it to the page.</p>
  
  <p>I'm just wondering, can my cleanFeedDescription() function be done a little cleaner and more optimized?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          var textString = '&amp;lt;img src=&amp;quot;/media/filter/small/transfer/a0/46/21ca7da7/3569/1774/cf3f/82634fc4/img/4th_of_july_209.jpg&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt; &amp;lt;p class=&amp;quot;long-description&amp;quot;&amp;gt;&amp;lt;span class=&amp;quot;uploaded-date&amp;quot;&amp;gt;Uploaded 2010-11-29 18:24:24&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;uploaded-by&amp;quot;&amp;gt;by gin_alvizo&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;uploaded-to&amp;quot;&amp;gt;part of Bull&amp;#039;s-Eye Bold BBQ powered by ...&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;';
  
          document.write(cleanFeedDescription(textString));
  
          function cleanFeedDescription(descString) {
  
              descString = descString.replace(/&amp;lt;/g, '&lt;');
              descString = descString.replace(/&amp;gt;/g, '&gt;');
              descString = descString.replace(/&amp;quot;/g, '"');
  
              return descString;
          };
      &lt;/script&gt;
  </code></pre>