class XLIFFResource 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 RuntimeException(e);
        }

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

        Element elem = document.getDocumentElement();
        NodeList nodeList = elem.getChildNodes();

        int version = (int) Float.parseFloat(elem.getAttribute(VERSION_STRING));

        LanguageBundleBuilder bb = new LanguageBundleBuilder(true);
        collectResourceStrings(nodeList, bb, version, "");
        return bb.build();
    }

}