You need to wrap the variables within double quotes, both in all=("$x" "$y") and "${all[@]}":
x="a b"
y="c d"
echo "Attempt XX"
all=("$x" "$y")
for i in "${all[@]}" ; do
echo "$i"
done
Which yields:
Attempt XX
a b
c d
You can also define the strings with:
all=("a b" "c d")
for i in "${all[@]}" ; do
echo "$i"
done