private String findElement(String response, String elementTag, String elementTypeLink, String elementName) throws InvalidObjectException, ConnectorException {
		Document doc = RestClient.stringToXmlDocument(response);
		NodeList list = doc.getElementsByTagName(elementTag); 
		
		for(int i=0; i < list.getLength();i++){
			if(list.item(i).getAttributes().getNamedItem(Constants.TYPE)!=null){
				if(list.item(i).getAttributes().getNamedItem(Constants.TYPE).getTextContent().trim().equalsIgnoreCase(elementTypeLink)) {
					if (elementName != null)
					{
						if(list.item(i).getAttributes().getNamedItem(Constants.NAME).getTextContent().trim().equalsIgnoreCase(elementName))
							return list.item(i).getAttributes().getNamedItem(Constants.HREF).getTextContent().trim();
					}
					else {
						return list.item(i).getAttributes().getNamedItem(Constants.HREF).getTextContent().trim();
					}
				}
			}	
		}
		
		//
		// if it reaches the end without finding the element, throw exception
		//
		if(elementName != null)
		{
			throw new InvalidObjectException("Element not found: " + elementName);
		}
		else 
		{
			throw new InvalidObjectException("Element not found: " + elementTypeLink);
		}
		
	}