Code example for SAXSource

        // add our XMLFilter which disables dtd downloading 
        NamespaceFilter xmlFilter = new NamespaceFilter(parser.getXMLReader());
        // Wrap the input stream with our filter 
        SAXSource source = new SAXSource(xmlFilter, new InputSource(in));
        // unmarshal the document 
        return unmarshaller.unmarshal(source);
    // todo Inject the proper namespace 
    public static class NamespaceFilter extends XMLFilterImpl {
        private static final InputSource EMPTY_INPUT_SOURCE = new InputSource(new ByteArrayInputStream(new byte[0]));
        public NamespaceFilter(XMLReader xmlReader) {
        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
            return EMPTY_INPUT_SOURCE;