public void export(ArrayList<String> ids, HashMap<String, ArrayList<String>> missing) {
        BufferedWriter writer = null;
        String f = originalName + ".missing.xml";
        try {
            writer = new BufferedWriter(new FileWriter(f));
            String[] parts = originalName.split("/");
            writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
            writer.write("<blocks id=\"" + parts[parts.length - 1] + "\">\n");
            for (String id : ids) {
                writer.write("\t<block id=\"" + id + "\">\n");
                Element el = getID(id);
                NodeList words = el.getElementsByTagName("w");
                for (int i = 0; i < words.getLength(); ++i) {
                    writer.write("\t\t" + words.item(i).getTextContent() + "\n");
                }
                writer.write("\t</block>\n");
            }
            for (String id : missing.keySet()) {

                if (missing.get(id).isEmpty()) {
                    continue;
                }

                writer.write("\t<block id=\"" + id + "\">\n");
                for (String word : missing.get(id)) {
                    writer.write("\t\t" + word + "\n");
                }
                writer.write("\t</block>\n");
            }
            writer.write("<blocks>\n");

        } catch (IOException ex) {
            //System.err.println("ERROR exporting"+f);
        } finally {
            try {
                writer.close();
            } catch (IOException ex) {
                Logger.getLogger(TEIManager.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }