public void parse(String fileName) {
        //insert text data into db
        int text_id = this.dbhelper.insertText(
                getString(TEXT_NODE_ANNOT, doc),
                getString(TEXT_NODE_AUTHOR, doc),
                getString(TEXT_NODE_DATE, doc),
                getString(TEXT_NODE_EDITOR, doc),
                getString(TEXT_NODE_SOURCE, doc),
                getString(TEXT_NODE_TITLE, doc),
                fileName);
        //
        //Паскаль begin
        int i,j;
        Sentence s;
        NodeList sentences = doc.getElementsByTagName(XML_NODE_SENTENCE);
        Node sentenceNode;
        Element sentenceElement;
        WordRU w;
        NodeList words;
        Node wordNode;
        Element wordElement;
        String link;
        int dom;
        //end

        for (i=0; i < sentences.getLength(); i++) {
                sentenceNode = sentences.item(i);

                if (sentenceNode.getNodeType() == Node.ELEMENT_NODE) {
                    sentenceElement = (Element) sentenceNode;

                    //insert sentence data into DB
                    int sentence_id = this.dbhelper.insertSentence(
                            Integer.valueOf(sentenceElement.getAttribute(SENTENCE_ATTR_ID)),
                            sentenceElement.getTextContent(),
                            text_id);

                    words = sentenceElement.getElementsByTagName(XML_NODE_WORD);
                    HashMap<Integer, Word> wordsMap = new HashMap<Integer, Word>();
                    for (j=0; j < words.getLength(); j++) {
                        wordNode = words.item(j);
                        if(wordNode.getNodeType() == Node.ELEMENT_NODE) {
                            wordElement = (Element) wordNode;
                            dom = 0;

                            if(!wordElement.getAttribute(WORD_ATTR_DOM).equals(XML_ROOT_NODE))
                                dom = Integer.valueOf(wordElement.getAttribute(WORD_ATTR_DOM));

                            //обработка токенов не имеющих связей
                            link = wordElement.getAttribute(WORD_ATTR_LINK);
                            if(link.length()==0)  link="NULL";
                            //

                            //создаем слово
                             w = new WordRU(dom,
                                    wordElement.getAttribute(WORD_ATTR_FEAT),
                                    Integer.valueOf(wordElement.getAttribute(WORD_ATTR_ID)),
                                    wordElement.getAttribute(WORD_ATTR_LEMMA),
                                    link,
                                    this.languageProperties);
                            //передаем слово и его хар-ки в db
                            //insert word data into db
                            this.dbhelper.insertWord(
                                    w.id,
                                    w.dom,
                                    w.lemma,
                                    w.link,
                                    wordElement.getTextContent(),
                                    w.featValues[0],
                                    w.properties,
                                    w.propertiesValues,
                                    sentence_id);
                            //

                            wordsMap.put(Integer.valueOf(wordElement.getAttribute(WORD_ATTR_ID)), w);
                        }
                    }

                    s = new Sentence(Integer.valueOf(sentenceElement.getAttribute(SENTENCE_ATTR_ID)),
                            wordsMap,null);

                    sentenceMap.put(s.id, s);
                }
            }
    }