Let $X \subset \mathbb{R}^{n}$, $Y \subset \mathbb{R}^{m}$, and $Z \subset \mathbb{R}^{p}$ be open subsets, and let $K_P \in C_0^\infty(X \times Y)$ and $K_Q \in C_0^{\infty}(Y \times Z)$. Then, $K_P$ and $K_Q$ define sequentially continuous linear mappings $P:C_0^\infty(Y) \longrightarrow C_0^\infty(X)$ and $Q:C_0^{\infty}(Z) \longrightarrow C_0^{\infty}(Y)$. Then, $P \circ Q: C_0^\infty(Z) \longrightarrow C_0^\infty(X)$ is a sequentially continuous linear mapping with kernel \begin{equation} K_{P \circ Q}=\int_{Y}K_P(\cdot,y)K_{Q}(y,\cdot)dy. \tag{*} \end{equation} Indeed, \begin{eqnarray*} \langle P \circ Q u,v \rangle_{\mathcal{D}'(X), \mathcal{D}(X)} &=& \langle K_P, v \otimes Qu \rangle_{\mathcal{D}'(X \times Y), \mathcal{D}(X) \otimes \mathcal{D}(Y)}\\&=& \int_{X \times Y} K_{P}(x,y)v(x)Qu(y)dx dy\\ &=& \int_{Y} Qu(y) \int_{X} K_P(x,y) v(x) dx dy\\ &=& \langle Qu, \int_{X} K_P(x,\cdot)v(x)dx \rangle_{\mathcal{D}'(Y), \mathcal{D}(Y)}\\ &=& \langle K_Q, \int_{X}K_P(x,\cdot)v(x)dx \otimes u \rangle_{\mathcal{D}'(Y \times Z), \mathcal{D}(Y) \otimes \mathcal{D}(Z)}\\ &=& \int_{Y \times Z} K_Q(y,z) \int_{X} K_P(x,y)v(x)dx u(z)dydz\\ &=& \int_{X \times Z} \int_{Y} K_{Q}(y,z)K_P(x,y)dyv(x)u(z)dxdz\\ &=& \langle \int_{Y}K_P(\cdot,y)K_Q(y,\cdot)dy, v \otimes u\rangle_{\mathcal{D}'(X \times Z), \mathcal{D}(X) \otimes \mathcal{D}(Z)}. \end{eqnarray*}
I would like to know what would be a generalization of $(*)$ for the kernel of the composition of operators with kernels in $\mathcal{D}'(X \times Y)$ and $\mathcal{D}'(Y \times Z)$. A priori it makes no sense to compose the operators generated by $K_P$ and $K_Q$ because they define operators (by the Schwartz Kernel Theorem) $P: \mathcal{D}(Y) \longrightarrow \mathcal{D}'(X)$ and $Q: \mathcal{D}(Z) \longrightarrow \mathcal{D}'(Y)$. So it may be necessary to impose some more conditions on the kernels (Maybe we should assume that $\hbox{supp } K_P$ and $\hbox{supp } K_Q$ are proper, in order to have properly supported operators). I also don't know if we can define the kernel as the integral, because in integrating we would have the product of two distributions.
Is there any book, article, that addresses this subject from a more general point of view (even if it is in the context of pseudodifferential operators)?