public void marshalIQWithError() throws JAXBException, XMLStreamException {
IQ iq = new IQ(IQ.Type.GET);
iq.setId("id");
iq.setTo(new Jid("to", "domain"));
iq.setFrom(new Jid("from", "domain"));
iq.setError(new StanzaError(StanzaError.Type.MODIFY, new ServiceUnavailable()));
String xml = marshal(iq);
Assert.assertEquals(xml, "<iq from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"get\"><error type=\"modify\"><service-unavailable xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"></service-unavailable></error></iq>");
}