if (requestSecurityEvents == null) {
requestSecurityEvents = Collections.emptyList();
}
final InboundSecurityContextImpl inboundSecurityContext = new InboundSecurityContextImpl();
inboundSecurityContext.putList(SecurityEvent.class, requestSecurityEvents);
inboundSecurityContext.addSecurityEventListener(securityEventListener);
inboundSecurityContext.put(XMLSecurityConstants.XMLINPUTFACTORY, xmlInputFactory);
DocumentContextImpl documentContext = new DocumentContextImpl();
documentContext.setEncoding(xmlStreamReader.getEncoding() != null ? xmlStreamReader.getEncoding() : "UTF-8");
//woodstox 3.2.9 returns null when used with a DOMSource
Location location = xmlStreamReader.getLocation();