changed RuntimeExceptions to XMLScanExceptions