You're only looping over 10 characters as defined by your for loop for (int i=0; i<10; i++)
. You want to loop over your entire string length and then XOR with your key mod 11.
for (int i=0; i<mystr.size(); i++) {
result.push_back(mystr[i] ^ key[i%11]);
cout << result[i];
}