validateToken(message, samlElement);
doc.getDocumentElement().removeChild(samlElement);
if (bodyIsRoot) {
message.setContent(XMLStreamReader.class,
new W3CDOMStreamReader(doc));
message.setContent(InputStream.class, null);
} else {
Element actualBody = getActualBody(doc.getDocumentElement());
if (actualBody != null) {
Document newDoc = DOMUtils.createDocument();
newDoc.adoptNode(actualBody);
message.setContent(XMLStreamReader.class,
new W3CDOMStreamReader(actualBody));
message.setContent(InputStream.class, null);
}
}
return null;