Due to the limited number of HDMI connections on my TV I upgraded my home theater receiver to one with 4 HDMI inputs. I use it for all video and audio switching and the TV stays on one input. Much cleaner cabling as well. An HDMI switch is also an option to look at too. Be aware an automatic switching HDMI switch probably will not work due to the way the ATV sleeps (not sure with the ATV2's). You'll probably need a manual one with push buttons or a remote.
For the problem at hand, first you need to know what audio input you need with the DVI in on your TV before we can help. To start with you are going to be using optical audio out from the ATV, a Toslink cable out of the ATV to be precise. If your TV's DVI connection matches up to a Toslink digital input that's all you need.
More than likely it has a single RCA jack which would be a Digital Coax in. In this case you will need a Digital Toslink to Digital Coaxial converter as well as a Digital Coax cable. The Coax cable can be a simple audio cable with RCA jacks.
If the DVI on the TV matches up with an analog in, usually red and white RCA jacks, you are going a Digital Toslink to an analog L/R stereo converter. And of course the RCA stereo cable.
MonoPrice.com is a great resource for cheap cables and converter boxes. Link to digital converters http://www.monoprice.com/products/subdepartment.asp?c_id=104&cp_id=10423