@Test
public void writeDeliverResponse() throws Exception {

    DeliverResponse deliverResponse = new DeliverResponse();
    deliverResponse.setErrorCode(5);
    deliverResponse.setErrorMessage("Success");
    StringWriter sw = new StringWriter();
    SxmpWriter.write(sw, deliverResponse);
    logger.debug(sw.toString());
    StringBuilder expectedXML = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"deliver\">\n")
        .append(" <deliverResponse>\n")
        .append("   <error code=\"5\" message=\"Success\"/>\n")
        .append(" </deliverResponse>\n")
        .append("</operation>\n")
        .append("");
    // compare to actual correct submit response
    XMLUnit.setIgnoreWhitespace(true);
    Diff myDiff = new Diff(expectedXML.toString(), sw.toString());
    DetailedDiff myDetailedDiff = new DetailedDiff(myDiff);
    Assert.assertTrue("XML are similar " + myDetailedDiff, myDetailedDiff.similar());
}