I also used this as a bit of a guide.
http://www.e46fanatics.com/forum/showthread.php?t=293116
It doesn't relate to our cars specifically but it shows the process you need to go through. The location of the connector block are pretty much the same as shown e.g. under the engine cover.
I got my replacement sensor from here;
http://www.cooper-bmw-parts.co.uk/
Good luck! (if you attempt it)