Updating tests
Minor refactoring
Fixing runtime exception caused by nil namespace prefix member
Minor refactoring
Minor reformatting
Adding xml test file and test cases