I am trying to get rid of the string in a xml file which contains some
special characters. I want it to be transformed from the following:

<message value="teststr: %F0wt^b%99%90%94%D4N%8D%FA%8A%EE%81_
g%9B@I%E3%F6%FCp%AFX%BD%80%91%B5pEK%C9!j%D3%F3SY%C3%F6B~%C8%FC
^%87%C4%F2]! %B9%DF=%E7Y%B9element:
%F0wt^b%99%90%94%D4N%8D%FA%8A%EE%81_
g%9B@I%E3%F6%FCp%AFX%BD%80%91%B5pEK%C9!j%D3%F3SY%C3%F6B~%C8%FC
^%87%C4%F2]! %B9%DF=%E7Y%B9"</message>

to

<message value="Validating element:"</message>

I tried using gsub() with regex but so far haven't been successful.

Can someone help me with this?

Thanks in Advance,
Rousan