@Test
public void writeDeliveryReportResponse() throws Exception {

    DeliveryReportResponse deliveryResponse = new DeliveryReportResponse();
    deliveryResponse.setErrorCode(5);
    deliveryResponse.setErrorMessage("Success");
    StringWriter sw = new StringWriter();
    SxmpWriter.write(sw, deliveryResponse);
    logger.debug(sw.toString());
    StringBuilder expectedXML = new StringBuilder(200)
        .append("<?xml version=\"1.0\"?>\n")
        .append("<operation type=\"deliveryReport\">\n")
        .append(" <deliveryReportResponse>\n")
        .append("   <error code=\"5\" message=\"Success\"/>\n")
        .append(" </deliveryReportResponse>\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());
}