You might want to remember that when dealing with products of transposed matrices, the following formula applies:

(AB)^{T} = B^{T} * A^{T}

EDIT: Proof here: http://www.proofwiki.org/wiki/Transpose_of_Matrix_Product

And for multiple products of transposes

(A_{1}A_{2}...A_{n-1}A_{n})^{T} = A_{n}^{T} * A_{n-1}^{T} * ... * A_{2}^{T} * A_{1}^{T}

Which is very similar to the product of inverses formula too (replace A^{T} with A^{-1}). The inverse formula is trivial to prove.

EDIT2: So, since your X, Y, Z rotation matrices are transposed, you should find that X^{T}Y^{T}Z^{T} = (ZYX)^{T}

i.e. your XYZ rotation matrix will be the other library's ZYX rotation matrix, transposed.