// Construct a raw surrogate pair character and confirm it outputs hex escaped
@Test
public void test_RawSurrogatePair() throws JDOMException, IOException, XMLStreamException {
SAXBuilder builder = new SAXBuilder();
builder.setExpandEntities(true);
Document doc = builder.build(new StringReader("<?xml version=\"1.0\"?><root>\uD800\uDC00</root>"));
Format format = Format.getCompactFormat().setEncoding("ISO-8859-1");
StAXStreamOutputter outputter = new StAXStreamOutputter(format);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLStreamWriter xsw = soutfactory.createXMLStreamWriter(baos, "ISO-8859-1");
outputter.output(doc, xsw);