final Item item = args[0].itemAt(0);
QNameValue qval;
try {
// attempt to convert the first argument to a QName
qval = (QNameValue) item.convertTo(Type.QNAME);
} catch (final XPathException e) {
// wrong type: generate a diagnostic error
throw new XPathException(this,
Messages.formatMessage(Error.FUNC_PARAM_TYPE,
new Object[] { "1", mySignature.toString(), null,