Normalizing the XML document before parsing