Is rail travel in europe a viable alternative to flying?

I am considering a holiday in spain (travelling from uk). these days, flying is a lot of hassle, what with the increase in security, and baggage restrictions. would someone recommend rail travel over air travel? is travelling 1st class worth the extra money?
Answer
Train travel is definitely worthwhile both environmentally and as a means of enjoying the journey. this is the best website for train travel in europe. enjoy! http://www.seat61.com/