diff --git a/src/test/java/org/json/junit/XMLTest.java b/src/test/java/org/json/junit/XMLTest.java
index d8aedb3..823a065 100644
--- a/src/test/java/org/json/junit/XMLTest.java
+++ b/src/test/java/org/json/junit/XMLTest.java
@@ -1184,7 +1184,9 @@ public class XMLTest {
JSONObject jsonObject = new JSONObject(jsonString);
String expectedXmlString = "two";
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(true));
- assertEquals(expectedXmlString, xmlForm);
+ JSONObject actualJsonObject = XML.toJSONObject(xmlForm);
+ JSONObject expectedJsonObject = XML.toJSONObject(expectedXmlString);
+ assertTrue(expectedJsonObject.similar(actualJsonObject));
}
@Test
@@ -1193,7 +1195,9 @@ public class XMLTest {
JSONObject jsonObject = new JSONObject(jsonString);
String expectedXmlString = "two";
String xmlForm = XML.toString(jsonObject,"encloser", new XMLParserConfiguration().withCloseEmptyTag(false));
- assertEquals(expectedXmlString, xmlForm);
+ JSONObject actualJsonObject = XML.toJSONObject(xmlForm);
+ JSONObject expectedJsonObject = XML.toJSONObject(expectedXmlString);
+ assertTrue(expectedJsonObject.similar(actualJsonObject));
}