private static void writeEdges(BufferedWriter writer, HashMap<String, Integer> lookup,
			List<NewRDPParserFileLine> list) throws Exception
	{
		HashSet<String> nodeLines = new LinkedHashSet<String>();
		for( NewRDPParserFileLine fileLine : list)
		{
			for( int x=TAXA_ARRAY.length- 1; x >=1; x--)
			{
				String level = TAXA_ARRAY[x];
				NewRDPNode node = fileLine.taxaMap.get(level);
				
				if( node != null)
				{
					String name = node.getTaxaName().replaceAll("\"", "");
					String key = level + "_" + name;
					int id = lookup.get(key);
					
					if( x > 1 )
					{
						String parentLevel = TAXA_ARRAY[x-1];
						NewRDPNode parentNode = fileLine.taxaMap.get(parentLevel);
						
						while( parentNode == null)
						{
							x--;
							parentLevel = TAXA_ARRAY[x-1];
							parentNode = fileLine.taxaMap.get(parentLevel);
						}
						
						String parentName = parentNode.getTaxaName().replaceAll("\"", "");
						String parentKey = parentLevel + "_" + parentName;
						int parentID = lookup.get(parentKey);
						nodeLines.add(
									"<edge source=\"" + parentID
										+"\" target=\"" + id+ "\"></edge>\n");
					}
					else
					{
						nodeLines.add(
								"<edge source=\"" + 1
									+"\" target=\"" + id + "\"></edge>\n");
					}
				}
			}
		}
			
			for(String s : nodeLines)
				writer.write(s);
		}