Example 13. Factorize:
$$
(x+y)^{3}+2xy(1-x-y)-1 .
$$
Let $x+y=u, x y=v$, then
$$
\begin{aligned}
& (x+y)^{3}+2 x y(1-x-y)-1 \\
= & u^{3}+2 v(1-u)-1 \\
= & \left(u^{3}-1\right)-2 v(u-1) \\
= & (u-1)\left(u^{2}+u+1-2 v\right) .
\end{aligned}
$$

Therefore, the original expression $=(x+y-1)\left(x^{2}+y^{2}+x+y+1\right)$.