If you have loose body in your ankle would they show on a x ray. Also would that cause your ankle to swell up.

Yes. Very possible. Yes, it would show up on xrays. It could cause pain and swelling in the ankle joint.
Not necessarily. A loose body can be a piece of cartilage which may not appear on an xray but would be visible on an MRI or ultrasound exam. Any trauma or injury can cause swelling. See an orthopedic surgeon for an evaluation.