@Test public void writeToOutputStream() throws IOException { XMLDocument doc = db.createFolder("/top").documents().load(Name.create(db, "foo"), Source.xml("<root/>")); ByteArrayOutputStream out = new ByteArrayOutputStream(); doc.write(out); out.close(); assertEquals("<root/>", out.toString()); }