You will find a lot of info in here, and the best way to start is to use the top left search box on this page because it targets this forum only. For example use it to find postings like THIS.
You will also discover info on the two main versions of the Z400 and that you probably do not have a generation 1 motherboard (I call that the Version 1, and there is Version 2 if you have the second major release of the Z400). That later one is what you own if you really have 6 instead of 4 memory sockets. The boot block date seen under the first tab in BIOS is another great way to tell.... it is 11/10/09 if you have Version 2 and 1/30/09 if you have Version 1.
AVID has a PDF on the Version 1 versus Version 2 issue HERE.
You need to read up on Mainstream versus Performance heatsink/fan for the Z400.... it is all in here. Most Z400s came with the Performance one, which can handle the hot 130W max TDP processors such as the x5690. That is what I'm running in our Version 2 Z400s here.
Update to the latest BIOS as a first step.
Memory..... this German company talks about the 6-slot Version 2 as being able to run 6 x 8GB sticks for 48 total, and they sell them too.... HERE. I have not tried that and there likely are certain 8GB sticks that work best for that. Search in the forum for that, and let us know with a followup post if you do that.
Google "Z400 spare parts" for the HP listing of what they have available and some part numbers. For the X5690 used on eBay search there for its single sSpec code of SLBVX. It works great.
Welcome, and good luck on your project.....