Midi uses only two of the 5 pins, not including the shield. XLR jacks also use two pins, plus a shield. Making an adapter is easy, you simply decide on a pinout and call that your 'standard' and make funny looking cables - one that has an XLR on one end, and a midi/din5 on the other:
Midi in:
1 - NC (not connected)
2 - NC
3 - NC
4 - IN +
5 - IN -
Midi out & thru
1 - NC
2 - NC
3 - Shield
4 - +5V 10ma
5 - out
Since midi out and thru jacks drive an LED or an optocoupler (which is an LED facing a phototransistor in a plastic or resin housing), the shield is generally not necessary because you can't really collect enough radio waves to drive an LED but you can connect it up if you're a purist
XLR cables have three pins:
1 - Chassis ground / cable shield
2 - positive signal
3 - negative signal
So, passing midi through an XLR patch panel is very easy - you have an XLR connector on one end, and a midi/din-5 connector on the other as I said above, like so:
XLR MIDI
1 ------- 3
2 ------- 4
3 ------- 5
--
If the cable is of good quality, you can pass other things through low-impedance mic wire, including s/pdif, aes/ebu (aes3), rs-422, midi as I described above, even rs-232 if you use no handshaking or software-only handshaking. All of the above simply requires homemade cables - one end matches the patch bay the other end matches the device, whatever it is.
You can also combine XLR/TRS jacks with homemade octopus cables to pass more complicated signals through the existing XLR/TRS patch bays. An example of this that I've done is Tascam's TDIF - and before anyone says "BULLSHIT! TDIF CANNOT GO THROUGH AN XLR CABLE!", I will say they are correct - not "an" XLR cable, but multiple cables! A TDIF cable is really just 8 low-impedence TRS cables in one rubbery sleeve with two 25-pin connectors on the ends. Nothing particularly special.
So, instead of using a TDIF cable that's 25p to 25p, you simply make two "octopus" cables that have a 25pin connector one end, and 8 TRS or XLR plugs on the other, matching your patch bay - one for each side - then you can pass TDIF through the existing low-impedence mic wiring that's between the vocal booth and the console room, getting a TDIF connector on both ends.
Of course you have to have eight XLR or TRS jacks available to do this, if you want bi-directional TDIF capabilities, as would be the norm.
My reason for doing this was to be able to place an old Tascam MA-AD8 in the vocal booth, and pass TDIF through the vocal booth wall to the console room, using the existing XLR and TRS patch bay I wired up years earlier. Since the MA-AD8 is not a bi-diretional device, I only had to wire up 4 TRS cables on
my octopus cable instead of 8 - the MA-AD8 only has outputs, no inputs, so why bother wiring them? I guessed at this based on various tascam high-level schematics I saw at the time (5-6 years ago or so) and it turned out my guess was correct.
Anyway, sorry this became so long-winded, I wanted to share the TDIF thing because even if you yourself don't need TDIF to pass through a patch bay, the idea of combining TRS wire pairs into a bigger connector for a specific device works very well and maybe now that's more obvious.
Sorry this is such a terrible picture, the flash on my ********** stinks. This is my patch bay, which has eight XLR jacks, and eight 1/4" TRS jacks immediately underneath - giving me 16 TRS pairs to work for non-standard functions as well as what would be considered the norm - a mic cable