9. As shown in Figure 4, in trapezoid $A B C D$, $A D / / B C$ $(B C > A D)$, $\angle D=$ $90^{\circ}$, $B C=C D=12$, $\angle A B E=45^{\circ}$. If $A E=$ 10, then the length of $C E$ is $\qquad$.
9.4 or 6.

As shown in Figure 4, extend $DA$ to point $M$ such that $BM \perp BE$. Draw $BG \perp AM$ with $G$ as the foot of the perpendicular.
It is easy to see that quadrilateral $BCDG$ is a square.
Therefore, $BC = BG$.
Also, $\angle CBE = \angle GBM$, so
Rt $\triangle BEC \cong$ Rt $\triangle BMG$.
Thus, $BM = BE$.
Since $\angle ABE = \angle ABM = 45^{\circ}$, we have
$\triangle ABE \cong \triangle ABM$, and $AM = AE = 10$.
Let $CE = x$, then
$$
\begin{array}{l}
AG = 10 - x, \quad AD = 12 - (10 - x) = 2 + x, \\
DE = 12 - x.
\end{array}
$$

In Rt $\triangle ADE$, $AE^2 = AD^2 + DE^2$, so
$$
100 = (x + 2)^2 + (12 - x)^2,
$$

which simplifies to $x^2 - 10x + 24 = 0$.
Solving this, we get $x_1 = 4, x_2 = 6$. Therefore, the length of $CE$ is 4 or 6.