Refactor: libcrmcommon: New pcmk__xpath_result_element()
To replace getXpathResult().
It would be simpler to just get the result node, regardless of type. I
suspect that all internal callers pass XPath expressions that could only
match element nodes anyway. However, the "get nearest reasonable
element" logic is now necessary for backward compatibility. At the very
least, the public CIB API (with cib_xpath) and cibadmin (with --xpath)
use this logic.
The decision to return elements for non-element matches in the first
place (commits 2b2f705 and d596d67) is highly questionable, and as
usual no justification was provided.
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>