public static void parseFile(File configFile, IntrfOfferTreeSaver intrfMobileTreeSaver) {

        try {
            // First create a new XMLInputFactory
            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            // Setup a new eventReader
            InputStream in = new FileInputStream(configFile);
            XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
            // Read the XML document


            while (eventReader.hasNext()) {
                XMLEvent event = eventReader.nextEvent();

                if (event.isStartElement()) {
                    StartElement startElement = event.asStartElement();
                    // If we have a item element we create a new item
                    if (startElement.getName().getLocalPart() == (CATEGORY)) {
                        category = new Category();
//                        Characters charac = startElement.asCharacters();
//                        String s = charac.getData();
//                        category.name = startElement.asCharacters().getData();// We read the attributes from this tag and add the date
//                        // attribute to our object
                        Iterator<Attribute> attributes = startElement.getAttributes();
                        while (attributes.hasNext()) {
                            Attribute attribute = attributes.next();
                            if (attribute.getName().toString().equals(ID)) {
                                String sId = attribute.getValue();
                                category.id = 0;
                                try{
                                    category.id = Long.valueOf(sId);
                                }catch (NumberFormatException e){
                                        System.err.println("NumberFormatException" + sId);
                                }
                            }
                            if (attribute.getName().toString().equals(PARENTID)) {
                                String sId = attribute.getValue();
                                category.id_par = Long.valueOf(sId);
                            }
                        }
                        category.name = eventReader.getElementText();
                        intrfMobileTreeSaver.addCategory(category);
                        // continue;
                        //                       String s = category.name;
                    }
                }
//                // If we reach the end of an item element we add it to the list
//                if (event.isEndElement() && category != null) {
//                    EndElement endElement = event.asEndElement();
//                    if (endElement.getName().getLocalPart() == (CATEGORY)) {
//                        intrfMobileTreeSaver.addCategory(category);
//                        category = null;
//                    }
//                }

            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }

    }