private static void readVersions( Element versionsElement, 
		MVD mvd ) throws Exception
	{
		TreeMap<Short,Version> versions = new TreeMap<Short,Version>();
		NodeList nl = versionsElement.getChildNodes();
		for ( int i=0;i<nl.getLength();i++ )
		{
			Node versionNode = nl.item( i );
			if ( versionNode.getNodeType() == Node.ELEMENT_NODE )
			{
				NamedNodeMap nodeMap = versionNode.getAttributes();
				Node idAttr = nodeMap.getNamedItem( "id" );
				Node groupAttr = nodeMap.getNamedItem( "group" );
				Node backupAttr = nodeMap.getNamedItem( "backup" );
				Node shortNameAttr = nodeMap.getNamedItem( "shortName" );
				Node longNameAttr = nodeMap.getNamedItem( "longName" );
				if ( idAttr == null || groupAttr == null 
					|| shortNameAttr == null || longNameAttr == null )
					throw new MVDException( 
						"missing id, group, short name or long name"
							+" for version" );
				String id = idAttr.getTextContent();
				String group = groupAttr.getTextContent();
				short backup = Version.NO_BACKUP;
				if ( backupAttr != null )
					backup = Short.parseShort( backupAttr.getTextContent() );
				String shortName = shortNameAttr.getTextContent();
				String longName = longNameAttr.getTextContent();
				Version v = new Version( Short.parseShort(group), backup, 
					shortName, longName );
				short idVal = Short.parseShort( id );
				versions.put( new Short(idVal), v );
			}
		}
		Set<Short> keys = versions.keySet();
		Iterator<Short> iter = keys.iterator();
		short old = 0;
		// TreeMap sorts on id
		while ( iter.hasNext() )
		{
			Short curr = iter.next();
			short currVal = curr.shortValue();
			if ( currVal != old+1 )
				throw new MVDException( "Missing version id "+(old+1) );
			mvd.addVersion( versions.get(curr) );
			old = curr.shortValue();
		}
	}