Validate XML after compositing everything, not in the middle. Have order conform to DTD.