Fix handling of &nbsp; improve XML error reporting.