Both results are indeed consistent, it all comes down to an integration by parts,
Starting from the textbook result, we can integrate by parts,
$$\int_0^{x_D}\frac{T^3x^4e^x}{(e^x-1)^2}dx = \frac{-x^4 T^3}{(e^x-1)}\Big|_0^{x_D}+\int_0^{x_D}\frac{4T^3 x^3}{e^x - 1}dx.$$
Now we rewrite the first term,
$$\frac{-x^4 T^3}{(e^x-1)}\Big|_0^{x_D} = \frac{-x_D^4 T^3}{(e^{x_D}-1)} = \frac{x_D^3 T^4}{(e^{x_D}-1)} \cdot \frac{-x_D}{T} = \frac{x_D^3 T^4}{(e^{x_D}-1)} \dfrac{\partial x_D}{\partial T}. $$
Then the first equation becomes,
$$\int_0^{x_D}\frac{T^3x^4e^x}{(e^x-1)^2}dx = \frac{x_D^3 T^4}{(e^{x_D}-1)} \dfrac{\partial x_D}{\partial T} +\int_0^{x_D}\frac{4T^3 x^3}{e^x - 1}dx,$$
which is the desired result.