builder.setExpandEntities(true);
Document doc = builder.build(new StringReader("<?xml version=\"1.0\"?><root att=\"𐀀 𐀀\" />"));
Format format = Format.getCompactFormat().setEncoding("ISO-8859-1");
XMLOutputter outputter = new XMLOutputter(format);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
outputter.output(doc, baos);
String xml = baos.toString();
assertEquals("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + format.getLineSeparator() +
"<root att=\"𐀀 𐀀\" />" + format.getLineSeparator(), xml);
}