The proposed solution by Delphium still requires you to switch cables for the use of your PC and Xbox. You also need a switch box like this
http://www.amazon.co.uk/Goobay-Out-Manual-DVI-Switch/dp/B000OGYFSIHere is an incredibly artsy ms paint drawing of the contraption:
You can substitute the HDMI->DVI converter and 1 duallink cable by an HDMI to DVI-D duallink cable like this one if it works out to be cheaper that way:
This would be the cable running from the HDMI splitter to the DVI switchbox.
Please note that dollarstore HDMI cables are sufficient. Here you can buy them for €2,50 each at a kind of dollarstore called Action. Same applies for the DVI cables. As long as they are DVI duallink cables, they can go as low as about €6,50 a piece here. Please note that you need
duallink cables, no single link. Dual link have all the pins in the grid. Single link cables are missing out on the middle pins.
Illustration of different DVI cables:
Please also note that the switch boxes and HDMI splitters are just examples of the products. We do not say the hyperlinked products are the cheapest to be found, or work as intended. Feel free to search for different brands and models to find cheaper substitutes.
______________________________
While you are at it messing with cables anyway, why not run an additional HDMI cable directly from the PC to the TV? Put your desktop in mirrored mode. Now you can enjoy PC games on your monitor and your TV at the same time as well, only costing you an additional €2,50 or your regional equivalent.