Utils: unit tests and a correction in xmlParse() to prevent an exception