You can not do it by just rotating around X and Y (in any order). You would have to rotate also around Z:
In[1]:= mZY = RotationMatrix[45. Degree, {0, 0, 1}] . RotationMatrix[45. Degree, {0, 1, 0}]
Out[1]= {{0.5, -0.707107, 0.5}, {0.5, 0.707107, 0.5}, {-0.707107, 0., 0.707107}}
In[2]:= EulerAngles[mZY, {1, 2, 3}]/Degree
Out[2]= {-35.2644, 30., 54.7356}
In[3]:= EulerAngles[mZY, {2, 1, 3}]/Degree
Out[3]= {35.2644, -30., 35.2644}