Back in 2004 I wrote an article for a book called ShaderX3 about how to tackle the shader permutation problem by automatically generating shaders from combinations of smaller code fragments.
Now Tim has created an XNA 4.0 implementation of this same idea. Sweet! (not to mention very flattering for me personally :-)