code: private SiftsEntity getSiftsEntity(Element empEl) {
  
  			//for each <employee> element get text or int values of
  			//name ,id, age and name
  
  			String type = empEl.getAttribute("type");
  			String entityId = empEl.getAttribute("entityId");
  
  			//Create a new Employee with the value read from the xml nodes
  			SiftsEntity entity = new SiftsEntity(type,entityId);
  
  			// get nodelist of segments...
  			NodeList nl = empEl.getElementsByTagName("segment");
  			if(nl != null && nl.getLength() > 0) {
  				for(int i = 0 ; i < nl.getLength();i++) {
  
  					//get the entity element
  					Element el = (Element)nl.item(i);
  
  					SiftsSegment s = getSiftsSegment(el);
  
  					logger.debug("new segment: " + s);
  					entity.addSegment(s);
  
  				}
  			}
  
  			logger.debug("new SIFTS entity: " + entity);
  			return entity;
  		}
docs: <entity type="protein" entityId="A">