} else if (attributeName instanceof QNameValue) {
// this is allowed in XQuery
localName = ((QNameValue)nameValue).getLocalName();
String namespaceURI = ((QNameValue)nameValue).getNamespaceURI();
namespace = new StringValue(namespaceURI);
if (namespaceURI.equals("")) {
prefix = "";
} else {
// we need to allocate a prefix. Any one will do; if it's a duplicate,
// a different one will be substituted