code: public static Node getFirstNode(Document doc, String xPathExpression) {
  			try {
  
  				XPathFactory xPathfactory = XPathFactory.newInstance();
  				XPath xpath = xPathfactory.newXPath();
  				XPathExpression expr;
  				expr = xpath.compile(xPathExpression);
  				NodeList nl = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
  				return nl.item(0);
  
  			} catch (XPathExpressionException e) {
  				e.printStackTrace();
  			}
  
  			return null;
  		}
docs: Get first node on a Document doc, give a xpath Expression
  
  @param doc
  @param xPathExpression
  @return a Node or null if not found