When using the SAAJ-RI 1.4.0 the following exception is thrown.
org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
And it happens in WSSecurityUtil.java:314
I have tracked it down to the static test in the top of that file to recognise java 9. It should handle SAAJ 1.4 as well.
I'll send a pull request on GitHub.