how to switch a LM317 voltage regulator / LED on and off?

Have a look at the attached schematic. This uses just a cheap 2N3094 and is overall a better way to do this. The caps are there for stability and transient response.