private Map<String, String> findElementByXpath(String xpath, Node from)
throws XPathExpressionException {
XPathExpression expr = xpath2.compile(xpath);
Element el = (Element) expr.evaluate(document, XPathConstants.NODE);
if (el == null) {
throw new NoSuchElementException("No element for xpath " + xpath);
}
checkIfElementIsAccessible(el);
String reference = el.getAttribute("ref");
String type = el.getNodeName();