added try-exception to XML parser code