Make XML-related tests more robust
Skip safe level tests on JRuby