Refactored some tests and added XML declaration tests