Alternatively,

return s.replace(/[<>&"']/g, function (ch) {
		return XML_CHAR_MAP[ch];
	});