Clean up implementation of xmlstats.rb.