private void readnotes(Node parent, Automaton root, Document document) {

		NodeList allNodes = parent.getChildNodes();
		ArrayList noteNodes = new ArrayList();
		for (int k = 0; k < allNodes.getLength(); k++) {
			if (allNodes.item(k).getNodeName().equals(NOTE_NAME)) {
				noteNodes.add(allNodes.item(k));
			}
		}
		for (int i = 0; i < noteNodes.size(); i++) {
			Node noteNode = (Node) noteNodes.get(i);
			if (noteNode.getNodeType() != Node.ELEMENT_NODE)
				continue;
			
			Map e2t = elementsToText(noteNode);

			java.awt.Point p = new java.awt.Point();
			boolean hasLocation = true;
            Object obj = (e2t).get(NOTE_TEXT_NAME);
            if(obj == null) continue;
			String textString = obj.toString();
			
			// Try to get the X coord.
			double x = 0, y = 0;
			try {
				x = Double.parseDouble(e2t.get(STATE_X_COORD_NAME).toString());
			} catch (NullPointerException e) {
				hasLocation = false;
			} catch (NumberFormatException e) {
				throw new DataException("The x coordinate "
						+ e2t.get(STATE_X_COORD_NAME)
						+ " could not be read for the note with text " + textString + ".");
			}
			// Try to get the Y coord.
			try {
				y = Double.parseDouble(e2t.get(STATE_Y_COORD_NAME).toString());
			} catch (NullPointerException e) {
				hasLocation = false;
			} catch (NumberFormatException e) {
				throw new DataException("The y coordinate "
						+ e2t.get(STATE_Y_COORD_NAME)
						+ " could not be read for the note with text " + textString + ".");
			}
			p.setLocation(x, y);
			
			
			root.addNote(new Note(p, textString));
		}
		
		
	}