I think in that price range you're looking at some compact pistols. Kel-Tec and the Ruger LCP are below $400 and are great guns (IMO). For a full size you're looking at possibility a Rock Island 1911.
You may be able to haggle down to that on a used Glock...
If you're dead set on your budget at $400 those are my recommendations. You can go to Auction Arms and use the advanced search feature
Auction Arms - Advanced Search and enter a price range.
I know this isn't what you asked but really if you want an XD you should just save up another $150 and buy one either online (for about $495 including shipping) add another $50 (lower if you shop around) for the FFL (gun store) to do the transfer. Here are some decent deals on XD's and a reliable firearm is worth the $
If this is for defensive purposes buy a gun you want. Trust me it sucks to buy a gun within your budget
RIGHT NOW as opposed to
waiting for the one you want in 1 or 2 months....think about it...
My $0.02