Id like to know if I can switch my Pentium D processor with a xeon

Being the same socket, the Xeon might work. It is only a 65W cpu so if it doesn't work, the wattage support won't be the problem. I think it will work. But to be sure you will need to check the cpu support list of your motherboard - online for their updated list with their latest bios version.

Edit: though I don't know why you would want to since the worst pentium D model is faster and has the same amount of cache.
 
If your motherboard BIOS supports it, I would think it would simply plug in and work. However, if it is not a server board, it may not have the processor ID built into the BIOS, and an upgraded BIOS may not have it either. As asked already, and I'll say the same thing, I am not sure why you would want to do that.