I'm reading "First steps in random walks" by Klafter and Sokolov, and I don't understand this step involving the Dirac delta function. They want to obtain the probability density of having a walker at $x$ after $n$ steps: $P_n(x)$. They begin with
\begin{equation} P_n(x)=\int_{-\infty}^\infty dy P_{n-1}(y)p(x-y), \qquad (1) \end{equation} where $p(x)$ is the probability density to take a step of length $x$. Then they reiterate (1) and obtain (making a change of variables, I suppose)
\begin{equation} P_n(x)=\int_{-\infty}^\infty\cdots \int_{-\infty}^\infty dx_1\cdots dx_{n-1} p(x_1)p(x_2)\cdots p(x-x_{n-1}), \qquad (2) \end{equation}
and then they introduce the Dirac delta function as a "formal trick", they say:
\begin{equation} P_n(x)=\int_{-\infty}^\infty\cdots \int_{-\infty}^\infty dx_1\cdots dx_n p(x_1)p(x_2)\cdots p(x_n) \delta \left(\sum_{i=1}^nx_i-x \right), \qquad (3) \end{equation}
My question is: how can we show (heuristically) the equivalence between (2) and (3)? I'm used to Dirac delta functions of the form $\delta(x-x_0)$, but not of the form at (3).
EDITED
Maybe it would help to notice that $P_n(x)$ is the probability density of the random variable $X_n:=\sum_{i=1}^nx_i$.