There are five XML characters that need to be escaped:
" "
' '
< <
> >
& &
And here is the solution ruakh provided over on stackoverflow
sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'