protected void testToNMS(MessageFactory messageFactory) throws Exception {
MimeHeaders headers = new MimeHeaders();
headers.addHeader("Content-Type", "text/xml;");
InputStream is = getClass().getClassLoader().getResourceAsStream("org/apache/servicemix/components/http/soap-response.xml");
SOAPMessage sm = messageFactory.createMessage(headers, is);
NormalizedMessage nm = new NormalizedMessageImpl();
new SaajMarshaler().toNMS(nm, sm);
Node node = new SourceTransformer().toDOMNode(new SourceTransformer().toStreamSource(nm.getContent()));
logger.info(new SourceTransformer().toString(node));
CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, "//*[local-name() = 'userId']");
Element root = (Element) iterator.nextNode();