Fixed erasing of XML declaration.