class AndroidStringsResource extends ResourceFilter {

    @Override
    public LanguageBundle parse(InputStream inStream, FilterOptions options)
            throws IOException, ResourceFilterException {

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
            builder = factory.newDocumentBuilder();
        } catch (ParserConfigurationException e) {
            // runtime problem
            throw new ResourceFilterException(e);
        }

        Document document = null;
        try {
            document = builder.parse(inStream);
        } catch (SAXException e) {
            throw new IllegalResourceFormatException(e);
        }

        Element elem = document.getDocumentElement();
        NodeList nodeList = elem.getChildNodes();
        List<ResourceString> resStrings = new LinkedList<>();
        collectResourceStrings(nodeList, 1 /* the first sequence number */, resStrings);

        LanguageBundle bundle = new LanguageBundle();
        bundle.setResourceStrings(resStrings);

        return bundle;
    }

}