Well, according to the Dimarzio site you've wired up the
X2N correctly, for their dual sound (series parallel) wiring. The ony difference is you've labelled one of the wires GRY which I presume corresponds to GREEN in the diagram...
I'm a bit confused as to the wiring of the neck pickup, It looks like the WHITE is the col tap wire, and there's a ground wire somewhere you haven't put on the diagram except that's not quite right as the ground is then on the wrong lug of the switch, if the WHITE is just the ground then you could just connect it to the volume pot casing as it doesn't need to be switched.
In fact that may be the source of your hum as you may be switching the ground on one of the pickups when you don't need to.
Also not on your diagram is a wire connected to the bridge to provide an ground connection for the strings, you may have this and just not drawn it but you need to check.
As a final point, it's best to make all ground connections to the same pot, usually volume, and you've got the X2N ground connected to the tone, should be ok but can cause noise.
Jim