Utilize the lock that came with the firearm (or get free from po po). Just run the cable through the slide and magwell and attach it to something near the firewall. Hidden out of view but quickly accessible for someone that knows it's there. Be creative. If you got an old vehicle and don't care, cut a slit in the seat and hide it in there using the same cable lock method.
Or to have some fun, take the slide off and keep it in your pocket, if anything you can still kind of pistol whip people.
Or get a cat liter box, fill it up with stinky wet poo poo and ziplock your XD and drop it in there.
Get a fruitcake, throw it in the back and stick it in there! When I say throw it, I mean throw it!
Oh btw, IANAL and not responsible if you catch any diseases or other injuries or psychological damage from these methods.