Deven posted a link to my thread about converting the lights. I looked up the 510 series since you said it was close to those. The problem I see, is not exactly in the length of the bulb, but the length of the HID bulb housing behind the bulb.
I've converted several types of lights to HIDs, and a friend wanted a set of slim off road lights converted. To do it, we had to take the back casing of the light and put a socket on the inside of it, and beat it down to make the housing have room for the back of the hid bulb. I wish I had pictures of it, and now the truck is totaled so I can't get anymore.
The 510 series light is only 1 3/4" deep from front glass to the back of the housing. The actual HID bulb is 1.5" long as mean green said. That only leaves 1/4" of room and I just measured and the back of the hid bulb is just under 3/4". Meaning you would need 1/2" just to make it fit the length of the light, and you'd need more clearance for the tolerance of the glass. The only way I can see this working, is to cut a hole in the back of the housing to allow the back of the bulb to fit, and if you did that, you'd have to find a way to re-seal them to keep water out.