SAXReader reader = new SAXReader(); Document document = reader.read(in);  Iterator i = document.getRootElement().elements().iterator(); while (i.hasNext()) { Element element = (Element) i.next();  XMLTranslator translator = XMLTranslatorRegistry.instance().getTranslator(element.getName()); if (translator == null) throw new DocumentException("Unknown element type: " + element.getName());  BugInstance bugInstance = (BugInstance) translator.fromElement(element);  add(bugInstance); }
readXML(in);
	public void readXML(String fileName) throws IOException, DocumentException {		BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));		SAXReader reader = new SAXReader();		Document document = reader.read(in);		Iterator i = document.getRootElement().elements().iterator();		while (i.hasNext()) {			Element element = (Element) i.next();			XMLTranslator translator = XMLTranslatorRegistry.instance().getTranslator(element.getName());			if (translator == null)				throw new DocumentException("Unknown element type: " + element.getName());			BugInstance bugInstance = (BugInstance) translator.fromElement(element);			add(bugInstance);		}	}