class MarshallingUtils {

	public static void marshal(Marshaller marshaller, Object graph, WebServiceMessage message) throws IOException {
		if (marshaller instanceof MimeMarshaller && message instanceof MimeMessage) {
			MimeMarshaller mimeMarshaller = (MimeMarshaller) marshaller;
			MimeMessageContainer container = new MimeMessageContainer((MimeMessage) message);
			mimeMarshaller.marshal(graph, message.getPayloadResult(), container);
		} else {
			marshaller.marshal(graph, message.getPayloadResult());
		}
	}

	private  MarshallingUtils();

}