public void testCanonicalizePrologAndEpilog() throws IOException {
Element pdu = new Element("doc");
Document doc = new Document(pdu);
doc.insertChild(new ProcessingInstruction("target", "value"), 0);
doc.insertChild(new Comment("comment 2"), 1);
doc.appendChild(new Comment("comment 3"));
doc.appendChild(new ProcessingInstruction("target", "value"));
String expected = "<?target value?>\n<!--comment 2-->\n<doc></doc>\n<!--comment 3-->\n<?target value?>";
ByteArrayOutputStream out = new ByteArrayOutputStream();
Canonicalizer canonicalizer = new Canonicalizer(out);