If PHP encounters characters in the parsed XML document that can not be represented in the chosen target encoding, the problem characters will be "demoted".
This example highlights XML code. It illustrates how to use an external entity reference handler to include and parse other documents, as well as how PIs can be processed, and a way of determining "trust" for PIs containing code.