in = getXMLInputFactory().createXMLStreamReader(is);
out = getXMLOutputFactory().createXMLStreamWriter(domResult);
}
else if (attachments != null && attachments.size() > 0) {
Attachment body = attachments.get(0);
ByteArrayInputStream bais = new ByteArrayInputStream(body.getContents());
in = getXMLInputFactory().createXMLStreamReader(bais);
out = getXMLOutputFactory().createXMLStreamWriter(os);
}
else {