Cleaned up the xml generator