Some test refactoring and added XmlRootAttribute support.