I don't understand what the shopt xpg_echo
changes if it is activated or deactivated.
In the manual:
xpg_echo
If set, the echo builtin expands backslash-escape
sequences by default.
I tried to activate/deactivate xpg_echo, but echo has the same behaviour.