if (idval.getItemType() == Type.NODE) { NodeSet set = (NodeSet) idval; for (int i = 0; i < idval.getLength(); i++) { QName id = new QName(set.get(i).getNodeValue(), "", null); getId(context, result, docs, id); } } else { QName id = new QName(idval.getStringValue(), "", null);
String nextId; for(SequenceIterator i = idval.iterate(); i.hasNext(); ) { nextId = i.nextItem().getStringValue(); QName id = new QName(nextId, "", null);
	public Sequence eval(		StaticContext context,		DocumentSet docs,		Sequence contextSequence,		Item contextItem)		throws XPathException {		if (getArgumentCount() < 1)			throw new XPathException("function id requires one argument");		if(contextItem != null)			contextSequence = contextItem.toSequence();		Expression arg = getArgument(0);		Sequence idval = arg.eval(context, docs, contextSequence);		NodeSet result = new ExtArrayNodeSet();		if (idval.getItemType() == Type.NODE) {			NodeSet set = (NodeSet) idval;			for (int i = 0; i < idval.getLength(); i++) {				QName id = new QName(set.get(i).getNodeValue(), "", null);				getId(context, result, docs, id);			}		} else {			QName id = new QName(idval.getStringValue(), "", null);			getId(context, result, docs, id);		}		return result;	}