I have both lenses and if you really like wide, there is nothing like the 10-22 on a crop sensor. If you've never really shot this wide, I think it is superb and something you have to at least try. 10mm is much, much wider than 17 mm, it doesn't even compare IMO. I think the 10-22 focuses closer too, which is a definite benefit with super-wide lenses to get close to the foreground. Unless you absolutely need weatherproofing I would highly recommend the 10-22 - it is still built pretty well and I wouldn't say the 17-40 feels that much more 'solid' or likely to last longer.
The only thing that annoys me about the 10-22 is the focus ring is near the rear element and the zoom near the front, the reverse of all the other zooms I have.
And one other slight annoyance actually. The CA doesn't seem as consistent (I don't seem to be able to find a consistent set of values for lighting and subject, which I can't quite explain) and is greater on the 10-22, but still mostly correctable in PP.