XMLTranslator translator = XMLTranslatorRegistry.instance().getTranslator(childName); if (translator == null) throw new DocumentException("Bad element type: " + childName);  BugAnnotation annotation = (BugAnnotation) translator.fromElement(child); bugInstance.add(annotation);
BugAnnotation annotation = (BugAnnotation) translator.fromElement(child); bugInstance.add(annotation); }
		public XMLConvertible fromElement(Element element) throws DocumentException {			try {				String type = element.attributeValue("type");				int priority = Integer.parseInt(element.attributeValue("priority"));				BugInstance bugInstance = new BugInstance(type, priority);				// Child elements are BugAnnotations				Iterator i = element.elements().iterator();				while (i.hasNext()) {					Element child = (Element) i.next();					String childName = child.getName();					XMLTranslator translator = XMLTranslatorRegistry.instance().getTranslator(childName);					if (translator == null)						throw new DocumentException("Bad element type: " + childName);					BugAnnotation annotation = (BugAnnotation) translator.fromElement(child);					bugInstance.add(annotation);				}				return bugInstance;			} catch (NumberFormatException e) {				throw new DocumentException("Invalid attribute value: " + e.toString());			}		}