XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream("document.xml")); while(reader.hasNext()){ int eventType = reader.next(); if(eventType == XMLStreamConstants.START_ELEMENT && reader.getLocalName().equals("title")){ String title = reader.getText(); System.out.println("Title: " + title); } }