Document document = DocumentHelper.createDocument();
document.addElement("root");
serializer.serialize(document, baos);
Document result = serializer.deserialize(new ByteArrayInputStream(baos.toByteArray()));
assertEquals(result.getRootElement().getName(),
document.getRootElement().getName());
}