// clone node inclusive text content
Element cloneElement = (Element) sourceElement.cloneNode(false);
cloneElement.setTextContent(DomUtils.getTextValue(sourceElement));
CandidateElement candidateElement =
new CandidateElement(cloneElement,
XPathHelper.getXPathExpression(sourceElement),
formInputsForCurrentIndex);
candidateElements.add(candidateElement);
}
return candidateElements;