The EASY way...
Alright, don't get to involved here. There is an easy way, and it only requires $1.58 + shipping + maybe a short piece of wire. Just get a Toslink transmitter. Toshiba makes some, but Sharp makes some more reasonably priced (same thing as Toshiba w/o the "Toslink(R)". The GP1FA511TZ transmitter can be bought and seen
here from Digikey. The price is $1.58 each, and it only requires three connections (see the link above for spec sheet/schematic).
Power it with a 5V supply from the existing PCB in your unit and attach to pin 2 (Vcc), tie pin 3 to ground, and run the coax output line into "Vin", or pin 1.
You could integrate this directly into your CD player chasis, or run the coax digital input into a female RCA connector mounted in a project box with this connector mounted right next to the coax input. Just use a small piece of COAX (I would recommend RG-6) to run from the RCA connector to the Vin pin on the Sharp Toslnik transmitter. Then just add a little battery operated power supply...
It's cheap... its easy... and you get the exact same thing that comes out any consumer DVD/CD/Minidisc player with a toslink output. I just can't understand why some companies dont' put the coax connector on there when they're running the electrical line right to the edge of the PCB and case to mount the Toslink connector/driver... ?!?! Doesn't make sense to me, but who am I?
Anyhoo, good luck -