Having some trouble showing that $S(\rho_{XB}||\sigma_{XB})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$ for $\rho_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}$ and $\sigma_{XB}=\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}$
I know that $$S(\rho_{XB}||\sigma_{XB})=\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))$$ and $$\mathrm{Tr}(\rho_{XB}\log(\rho_{XB}))=-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})$$ due to its classical-quantum nature. However, this implies that $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=S(X)+\sum_{x}p(x)S(\rho_{B}^{x})+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$.
Taking $$-\mathrm{Tr}(\rho_{XB}\log(\sigma_{XB}))=-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x} \log(\sum_{x}p(x)|x\rangle\langle x|\otimes\sigma_{B}^{x}))=$$
$$-\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}(\sum_{x}|x\rangle\langle x|\otimes \log(p(x)\sigma_{B}^{x})))=\mathrm{Tr}(\sum_{x}p(x)|x\rangle\langle x|\otimes\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=$$
$$-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}\log(p(x)\sigma_{B}^{x}))=-\sum_{x}p(x)\mathrm{Tr}(\rho_{B}^{x}(\log(p(x))+\log(\sigma_{B}^{x})))=$$
$$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$
As can be seen, this is not enough to cancel the other terms, which can be seen when putting these two together, you get $$-S(X)-\sum_{x}p(x)S(\rho_{B}^{x})+S(X)+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})=\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})-\sum_{x}p(x)S(\rho_{B}^{x})$$ This could only equal the desired exprerssion if $\rho_{B}^{x}$ were pure states, which is specified nowhere in the text I am reading.
Where have I gone wrong?
Edit: As Rammus stated in his answer, I went wrong with $$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))+\sum_{x}p(x)D(\rho_{B}^{x}||\sigma_{B}^{x})$$ Instead, it should be $$-\sum_{x}p(x)(\mathrm{Tr}(\rho_{B}^{x}(\log(p(x)))+\mathrm{Tr}(\rho_{B}^{x}\log(\sigma_{B}^{x})))=-\sum_{x}p(x)\log(p(x))-\sum_{x}p(x)Tr(\rho_{B}^{x}log(\sigma_{B}^{x}))$$ Putting this back into the original equation gives the desired equality.