Improvement of REXML and speed up using StringScanner

Ruby