If all the inputed notes play back in one second at the beginning of the song, it is probably not because of the midi cable. I don't know what is the problem.
But for the troubles you encounter with Cakewalk, you should try to change the midi cable (even if it is brand new. Mine was new too, but it didn't work. My retailer told me that it often happens with certain brands of midi cables).
To test your cable, you should try to use the software provided with the synth to load and edit a patch with your computer. If it doesn't work, then your cable has to be changed. You can also test the midi connexion by setting the midi thru function on (in Cakewalk), and setting the local function off (in the XP30, in the menu system-midi). When you play, you have to hear exactly what you play. If it doesn't work properly, then you probably have troubles with the cable.
I didn't notice the gap between the notes on my XP30.