Added exception handling for xml parser