const fs = require('fs'); const file = fs.readFileSync('cms_module_news.xml'); const text = file.toString(); const out = text.replace(/([^<]*)<\/column>/mg, (match, p1, p2) => { return '<' + p1 + '>' + p2 + ''; }); fs.writeFileSync('cms_module_news_replaced.xml', out);