Completed test for Xml. Accompanied by small fixes in code