Cleaned up the xml class, revealing a bug in the tests.