public void validate(Source source, Result result) throws SAXException,
IOException {
if (result instanceof StAXResult || result == null) {
StAXSource staxSource = (StAXSource) source;
StAXResult staxResult = (StAXResult) result;
try {
XMLStreamReader streamReader = staxSource.getXMLStreamReader();
if (streamReader != null) {
// Hand off to XMLStreamReader helper.
if (fStreamHelper == null) {