code: private IConfigurationElement getParserWithHeighestPriority(
  			String natureId, IConfigurationElement[] config)
  	{
  		IConfigurationElement selectedParser = null;
  		int selectedParserPriority = 0;
  		for (IConfigurationElement e : config)
  		{
  			if (e.getAttribute("nature").equals(natureId))
  			{
  				if (selectedParser == null)
  				{
  					selectedParser = e;
  					String selectedParserPriorityString = selectedParser
  							.getAttribute("priority");
  					if (selectedParserPriorityString != null)
  						selectedParserPriority = Integer
  								.parseInt(selectedParserPriorityString);
  				} else
  				{
  					String parserPriorityString = selectedParser
  							.getAttribute("priority");
  					if (parserPriorityString != null)
  					{
  						int parserPriority = Integer
  								.parseInt(parserPriorityString);
  						if (parserPriority > selectedParserPriority)
  						{
  							selectedParser = e;
  							selectedParserPriority = parserPriority;
  						}
  					}
  				}
  			}
  		}
  		return selectedParser;
  	}
docs: Gets the parser available for the given nature having the highest
  priority
  
  @param natureId
  the nature to lookup a parser for
  @param config
  the configuration of the extension point
  @return a valid source parser or null