url = url + "&set=" + "beilstein";
System.out.println("Fetching " + url);
Document doc = new Builder().build(url);
System.out.println("Fetched!");
//new Serializer(System.out).write(doc);
XPathContext xpc = new XPathContext();
xpc.addNamespace("oai", "http://www.openarchives.org/OAI/2.0/");
xpc.addNamespace("art", "http://dtd.nlm.nih.gov/2.0/xsd/archivearticle");
while(doc != null) {
Nodes paperNodes = doc.query("/oai:OAI-PMH/oai:ListRecords/oai:record/oai:metadata/art:article", xpc);
System.out.println("Found " + paperNodes.size() + " papers");
for(int i=0;i<paperNodes.size();i++) {