public void parse(String fileName){

        int i,j;
        Sentence s;
        NodeList sentences =  doc.getElementsByTagName(XML_NODE_SENTENCE);
        Node sentenceNode;
        Element sentenceElement;
        WordSW w;
        NodeList words;
        Node wordNode;
        Element wordElement;
        String link;
        int dom;

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

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

                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 || wordElement.getAttribute(WORD_ATTR_LINK)==null)  link="NULL";
                        //

                        //создаем слово
                        w = new WordSW(dom,
                                partOfSpeechMeta.get(wordElement.getAttribute(WORD_ATTR_FEAT)),
                                Integer.valueOf(wordElement.getAttribute(WORD_ATTR_ID)),
                                wordElement.getAttribute(WORD_ATTR_LEMMA),
                                wordElement.getAttribute(WORD_ATTR_LINK));

                        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);
            }
        }

    }