There's bound to have been an A4 owner who has retro fitted HID's previously and posted about it on an owners forums somewhere. Have a search with Google, I'm pretty sure it will throw up some results and possibly even photos of ballast locations, wiring etc.
Ballasts can be fitted anywhere under the bonnet but obviously the length of the wiring contained within the kit will dictate the distance from the bulbs. Try and mount them securely ( obviously - you don't want them falling off at any point ) and out of any area which will suffer from road spray. A secure fit is important for longevity and serviceability of the units as excessive vibration will do them no favours. They do end up getting fairly hot but airflow over them for cooling isn't a prime consideration as they are generally fairly robust and to be honest, most areas under the bonnet get a fairly reasonable circulation of air anyway.
Ballasts can be fitted anywhere under the bonnet but obviously the length of the wiring contained within the kit will dictate the distance from the bulbs. Try and mount them securely ( obviously - you don't want them falling off at any point ) and out of any area which will suffer from road spray. A secure fit is important for longevity and serviceability of the units as excessive vibration will do them no favours. They do end up getting fairly hot but airflow over them for cooling isn't a prime consideration as they are generally fairly robust and to be honest, most areas under the bonnet get a fairly reasonable circulation of air anyway.