title: How to replace string in Javascript
body: <p>I am trying to replace <code>'&lt;p&gt;hi&lt;/p&gt;'</code> with 'hi'</p>
  
  <p>My JavaScript:</p>
  
  <pre><code>var obj = {item:{title: params.title,description: params.text, link: req.headers['origin']+"/blog/blog-description/"+params.blog_id, guid:req.headers['origin']+"/blog/blog-description/"+params.blog_id}};
  
  var xml2js = require('xml2js');     
  var builder = new xml2js.Builder();
  var xml = builder.buildObject(obj);
  var modXml = xml.replace('&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;', '');
  var modXml = xml.replace(/&lt;(?:.|\n)*?&gt;/gm, '');         
  var new_text = modXml;
  
  fs.readFile('public/feed.xml', function read(err, data) {
      if (err) throw err;
      var file_content = data.toString();
      var c = file_content.indexOf('&lt;/description&gt;');
      var position = c + 14;
      file_content = file_content.substring(position);
      var file = fs.openSync('public/feed.xml','r+');
      var bufferedText = new Buffer(new_text+file_content);
      fs.writeSync(file, bufferedText, 0, bufferedText.length, position);
      fs.close(file);
  });
  </code></pre>
  
  <p>i didnt know where it went wrong can someone suggest help.</p>