Welcome to CPF!
Uhmm...i don't see why not. Can't imagine how you'd pack 4 AAs into an X5 body though. Actually...which colour X5 do you have, most X5 colours run on 2 primaries but the red runs on 1 only...i think there was another that runs on one only but not 100%.
Anyways back to 4AA into X5 body...i really can't see how you'd make them fit (You're going to need four as alks are 1.5V vs primaries which are 3V). Maybe you can try AAAs...otherwise you can make a pack/holder and lead some wires onto the light's contacts, won't be elegant though.
If you know what you're doing with LIon rechargeables, perhaps you can use two AAA LIons, it will overdrive the LEDs a bit though and possibly damage them etc. Or alternatively, can try some 3V rechargeable 123s, just make sure they are the regulated 3V variety. Most rechargeable 123s are rated at 3.7V.
Just read your post again...if you want to stick with 4 NiMH's...i think you're going to have to use an external holder/pack.