try {
Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputMessage.getBody());
XPathExpression titlesXp = XPathExpressionFactory.createXPathExpression("/ResultSet/Result[@type='incident']/Title");
List<Node> titles = titlesXp.evaluateAsNodeList(document);
XPathExpression descXp = XPathExpressionFactory.createXPathExpression("/ResultSet/Result[@type='incident']/Description");
List<Node> description = descXp.evaluateAsNodeList(document);
int counter = 0;
for (Node node : titles) {
traffic.addIncident(((Element)node).getTextContent(), ((Element)description.get(counter++)).getTextContent());