Now using the dom level 3 API for parsing. Also extended the test case