public void testXml11() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XMLSerializer sax2xml = new XMLSerializer(baos, false);
sax2xml.setOutputProperty(OutputKeys.VERSION, "1.1");
ContentHandler ch = sax2xml.getContentHandler();
ch.startDocument();
ch.startElement("","foo","foo", new AttributesImpl());
ch.endElement("", "foo", "foo");
ch.endDocument();
String xmlStr = new String(baos.toByteArray(), "UTF-8");
assertEquals("<?xml version=\"1.1\" encoding=\"UTF-8\"?><foo/>", xmlStr);