Escapes a string by replacing each instance of XML markup characters by their
predefined entity or decimal character reference, so that they are
interpreted literally in text content or attributes.
Each of the following characters is replaced by the corresponding sequence:
& → &
< → <
> → >
' → '
" → "
\t → 	 (TAB)
\n → (LF)
\r → (CR)
Parameters
s: string
A string to be escaped as XML content.
Returns string
Returns a new string where each XML markup character is replaced
by their escape sequence.
Example
xmlEscape("<div>Fish & chips</div>"); // "<div>Fish & chips</div>"
Escapes a string by replacing each instance of XML markup characters by their predefined entity or decimal character reference, so that they are interpreted literally in text content or attributes.
Each of the following characters is replaced by the corresponding sequence:
&→&<→<>→>'→'"→"\t→	(TAB)\n→ (LF)\r→ (CR)