if (name == null || description == null || context == null) throw new SAXException("Missing required attribute");
	public void addFromStream(InputStream stream) throws CoreException {		try {			DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();			DocumentBuilder parser= factory.newDocumentBuilder();					Document document= parser.parse(new InputSource(stream));			NodeList elements= document.getElementsByTagName(TEMPLATE_TAG);						int count= elements.getLength();			for (int i= 0; i != count; i++) {				Node node= elements.item(i);									NamedNodeMap attributes= node.getAttributes();				if (attributes == null)					continue;				String name= attributes.getNamedItem(NAME_ATTRIBUTE).getNodeValue();				String description= attributes.getNamedItem(DESCRIPTION_ATTRIBUTE).getNodeValue();				String context= attributes.getNamedItem(CONTEXT_ATTRIBUTE).getNodeValue();				Node enabledNode= attributes.getNamedItem(ENABLED_ATTRIBUTE);				boolean enabled= (enabledNode == null) || (enabledNode.getNodeValue().equals("true")); //$NON-NLS-1$				StringBuffer buffer= new StringBuffer();				NodeList children= node.getChildNodes();				for (int j= 0; j != children.getLength(); j++) {					String value= children.item(j).getNodeValue();					if (value != null)						buffer.append(value);				}				String pattern= buffer.toString().trim();				Template template= new Template(name, description, context, pattern);					template.setEnabled(enabled);				add(template);			}				sort();		} catch (ParserConfigurationException e) {			throwReadException(e);		} catch (IOException e) {			throwReadException(e);		} catch (SAXException e) {			throwReadException(e);		}	}