added use of xpath and refactored code
added exceptions and tests for xml parser