The Core i5 is overall better than the Phenom II X4.
Click link below for comparison between the Phenom II X4 955 (945 is not listed as an option) and the i5-2500k. The i5 beats the PII X4 in every single category.
Note: In some tests, the higher the score the better. In others, the lower the score the better.
Price factor aside, the i5 (assuming you are talking about the quad cores doesn't matter first Gen or second Gen) beats the X4 fair and square. In fact if you just look at the processor prices the i5 gives better price to performance ratio.