That will work, but only if the 1/4" connectors are TRS (Tip-Ring-Sleeve). The way to tell is there should be a narrow ring (usually but not always black) about 2/3 of the way up the shaft (towards the tip) of the connector. A Tip-Ring jack, on the other hand, will have a smooth unmarked shaft until it reaches the indentation right before the tip.
The reason why it is important is that an XLR mic cable is balanced and requires three conductors within the cable, which the TRS jack supplies. A Tip-Ring is only two conductors, which will unbalance the signal, and also, I believe, prevent phantom power from reaching the mic.