String expected = "" +
"<?xml version='1.0' encoding='utf-8'?>\n" +
"<root attribute=\"value with "quotes" & 'apostrophes'\" second=\"other <value>\" />";
assertEquals(expected.trim(), xml.trim());
XMLReader reader = new XMLReader();
document = reader.parse(xml);
root = document.getRootNode();
assertEquals("root", root.getName());
assertEquals("", root.getContents());
assertEquals(false, root.hasChildNodes());
assertEquals(false, root.hasContents());