  We present the calculation of the master integrals needed for the two-loop
QCDxEW corrections to $ q + \bar{q} \to l^- + l^+$ and $ q + \bar{q}' \to l^- +
\overline{\nu} \, , $ for massless external particles. We treat W and Z bosons
as degenerate in mass. We identify three types of diagrams, according to the
presence of massive internal lines: the no-mass type, the one-mass type, and
the two-mass type, where all massive propagators, when occurring, contain the
same mass value. We find a basis of 49 master integrals and evaluate them with
the method of the differential equations. The Magnus exponential is employed to
choose a set of master integrals that obeys a canonical system of differential
equations. Boundary conditions are found either by matching the solutions onto
simpler integrals in special kinematic configurations, or by requiring the
regularity of the solution at pseudo-thresholds. The canonical master integrals
are finally given as Taylor series around d=4 space-time dimensions, up to
order four, with coefficients given in terms of iterated integrals,
respectively up to weight four.
