can replace this with a helper function:

getStringValue(xpathtext, xpathAttr->queryChild(0));

again though... need to be careful about utf8 and unicode.