Can I use a Shimano XT 11-gear derailleur with a 10 ring cassette on a mountainbike? I put a 40-11T 10-gear cassette on my mountainbike, but did not check whether it was compatible with my current xt shadow+ derailleur. Now the derailleur rubs against the cassette in higher gears. In the future I would like to put on an 11-gear cassette. 
So that I don't have to buy a new derailleur now and then again in a year or so I would like to install a derailleur that will work with both.
Is this possible?
Thanks
10 and 11 speed systems are not compatible. The pull ratio of the shifters is different, as is the cog spacing of the clusters.

You may get away with some combinations of frankien-mixandmatch, but as the drive chain wears, the differences become more problematic. Ultimately, most find its not worth the problems it creates.