public List<BibtexEntry> importEntries(InputStream stream) throws IOException {
ArrayList<BibtexEntry> bibItems = new ArrayList<BibtexEntry>();
// Obtain a factory object for creating SAX parsers
SAXParserFactory parserFactory = SAXParserFactory.newInstance();
// Configure the factory object to specify attributes of the parsers it
// creates
// parserFactory.setValidating(true);
parserFactory.setNamespaceAware(true);
// Now create a SAXParser object
try{
SAXParser parser = parserFactory.newSAXParser(); //May throw exceptions
BibTeXMLHandler handler = new BibTeXMLHandler();
// Start the parser. It reads the file and calls methods of the handler.
parser.parse(stream, handler);
// When you're done, report the results stored by your handler object
bibItems = handler.getItems();