4. In $\triangle A B C$, let the largest angle $\angle A$ be twice the smallest angle $\angle C$, and $A B=2, A C=3$. Then the perimeter of $\triangle A B C$ is ( ).
(A) $9-\sqrt{13}$
(B) $5 \sqrt{3}-\sqrt{10}$
(C) $4 \sqrt{2}$
(D) $5+\sqrt{10}$
4. D.

As shown in Figure 5, extend $CA$ to point $D$ such that $AD = AB$, and connect $BD$. Then
$$
\begin{array}{l}
\angle D = \angle ABD \\
= \frac{1}{2} \angle CAB \\
= \angle C.
\end{array}
$$

Therefore, $\triangle CBD \sim \triangle DAB$
$$
\Rightarrow \frac{BD}{AB} = \frac{CD}{BD} \Rightarrow BC = BD = \sqrt{10} \text{.}
$$

Thus, the perimeter of $\triangle ABC$ is $5 + \sqrt{10}$.