Basically the gas or gases are there to enable the filament to burn hotter, therefore whiter and brighter. This means a thinner wire coiled into a filament.
Halogen gases are very unreactive and stop too mucg tungsten eevaporating from the filament.
The Xenon ones work slightly differently, so I believe. The Xenon gas reacts with the tungsten (don't know how) and keeps the gaseous metal in a colourless 'cloud'. WHen you turn off apparently this cloud condenses and redeposits metal onto the filament.
Xenon, is a member of the group of halogen gases anyway - so???
I have no idea why it doesn't condense on the inside of the glass envelope.
Try this for a better explanation:
http://members.misty.com/don/xeincand.html