It turned out to be the door control unit, which is the electonic circuit board that sits on top of the window winder mechanism. You cannot get this part separately, perversely you have to replace the electric window winder motor to get your door to open, which comes with the circuit board and plug attached to the top!
Mk4 Golfs did have random door locking and unlocking problems on models before about 2002, see this excellent article if your problem is an intermittent lock problem, which explains how to dismantle the door lock and re-solder dry joints:
http://forums.vwvortex.com/zerothread?id=1542461
However, if your problem appears to be the same as the one I had ie. no matter how many times you press the unlock button on the remote or the drivers door, or tap the door in the area of the lock, then the chances are that the door control unit has gone.
To doubly make sure, remove the door trim panel - in the rear, I had to take the back seat out and even then use a bit of brute force as I could not get to one of the retaining screws at the bottom. You can then check the voltages at the back of the plug that goes to the window winder motor.
With the ignition on, you should have +12V on the Red/Yellow and Red/White, using the brown as the 0V.
You should also have +12V between the Orange/Brown (Bus Low) and the Orange/Green (Bus High) - This is where the control signal comes in which then goes on to the motor in the door lock unit - this motor pulses back and forth in order to release the deadlock tab and unlock/lock the door.
When you press unlock, you should get brief pulses of +12V on both the lilac and blue wires which lead to the door lock motor. If you disconnect the plug from the window winder motor, you should have a low resistance reading between the lilac and blue wires, which is basically the motor coil resistance - if this is open circuit, then it is the door lock motor which is gone.
If more than one door is affected then it is most probably a simple fuse, 37 or 38.
If you still have problems then post a reply as I ended up drilling a hole in the inside of the door, to access the door lock motor - I managed to manually rotate the motor by its drive cog and release the deadlock tab. That's another story though and was at a stage when I was convinced that it was the door lock that was at fault. If you ever get to that stage, I could take photos of where to drill holes - I dismantled the opposite door and took accurate measurements before getting the black and decker out!
I even spoke to my local VW dealer who swore blind that replacing the window winder motor would not affect the door lock - when I started speaking to him about bus systems he was completely lost...