Yes, this will work. Just get any Shimano mountain rear derailleur... SLX, deore, LX, xt, xtr, etc...
EDIT:
This only applies for 9 speed and lower. Here's a quote from Sheldon Brown.
Within a given brand/style of rear derailer, all "speed numbers" are generally interchangeable. This applies to all indexable models, basically everything manufactured since the late 1980s. There are a few exceptions:
http://sheldonbrown.com/speeds.html
The exception for Shimano
Shimano "Dyna-Sys" 10-speed shifters and derailers use a longer cable pull than other Shimano models, and must be used together.