if (content instanceof StreamSource && !(content instanceof StringSource) && !(content instanceof BytesSource) && !(content instanceof ResourceSource)) {
if ((content instanceof StreamSource || content instanceof SAXSource) && !(content instanceof StringSource) && !(content instanceof BytesSource) && !(content instanceof ResourceSource)) {
    public boolean transform(MessageExchange exchange, NormalizedMessage from, NormalizedMessage to) throws MessagingException {        copyProperties(from, to);        Source content = from.getContent();        if (content instanceof StreamSource &&         	!(content instanceof StringSource) &&        	!(content instanceof BytesSource) &&        	!(content instanceof ResourceSource)) {            // lets avoid stream open exceptions by using a temporary format            try {                content = sourceTransformer.toDOMSource(from);            }            catch (TransformerException e) {                throw new MessagingException(e);            }             catch (ParserConfigurationException e) {                throw new MessagingException(e);            }             catch (IOException e) {                throw new MessagingException(e);            }             catch (SAXException e) {                throw new MessagingException(e);            }        }        to.setContent(content);                copyAttachments(from, to);        return true;    }