Improved XML scanner somewhat.  More basic but also more effective.