private AttributesImpl extractAttributes(Attributes attributes) {
        AttributesImpl attrs = new AttributesImpl();
        if (null != attributes.getValue("xml:lang")) {
            String lang = attributes.getValue("xml:lang");
            attrs.addAttribute("", "lang", "lang", "", lang);
            if (!lang.equalsIgnoreCase(sourceLang)) {
                targetLanguages.add(lang);
            }
        }
        if (null != attributes.getValue("o-encoding")) {
            attrs.addAttribute("", "original-encoding", "original-encoding", "", attributes.getValue("o-encoding"));
        }
        if (null != attributes.getValue("datatype")) {
            attrs.addAttribute("", "datatype", "datatype", "", attributes.getValue("datatype"));
        }
        if (null != attributes.getValue("usagecount")) {
            attrs.addAttribute("", "usagecount", "usagecount", "", attributes.getValue("usagecount"));
        }
        if (null != attributes.getValue("lastusagedate")) {
            attrs.addAttribute("", "lastusagedate", "lastusagedate", "", attributes.getValue("lastusagedate"));
        }
        if (null != attributes.getValue("creationdate")) {
            attrs.addAttribute("", "creationdate", "creationdate", "", attributes.getValue("creationdate"));
        }
        if (null != attributes.getValue("creationid")) {
            attrs.addAttribute("", "creationid", "creationid", "", attributes.getValue("creationid"));
        }
        if (null != attributes.getValue("changedate")) {
            attrs.addAttribute("", "changedate", "changedate", "", attributes.getValue("changedate"));
        }
        if (null != attributes.getValue("changeid")) {
            attrs.addAttribute("", "changeid", "changeid", "", attributes.getValue("changeid"));
        }
        if (null != attributes.getValue("tuid")) {
            attrs.addAttribute("", "tuid", "tuid", "", attributes.getValue("tuid"));
        }
        if (null != attributes.getValue("o-tmf")) {
            attrs.addAttribute("", "o-tmf", "o-tmf", "", attributes.getValue("o-tmf"));
        }
        return attrs;
    }
Content Handler for Translation Memory eXchange (TMX) files.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-xml-module/src/main/java/org/apache/tika/parser/tmx/TMXContentHandler.java