// XXX: understand: check permissions here? No, it may slowdown, better to check final set
BytesRef ref = new BytesRef(buf);
this.nodeIdValues.get(doc, ref);
int units = ByteConversion.byteToShort(ref.bytes, ref.offset);
NodeId nodeId = db.getNodeFactory().createFromData(units, ref.bytes, ref.offset + 2);
//LOG.info("doc: " + docId + "; node: " + nodeId.toString() + "; units: " + units);
NodeProxy storedNode = new NodeProxy(storedDocument, nodeId);
if (qname != null)
storedNode.setNodeType(qname.getNameType() == ElementValue.ATTRIBUTE ? Node.ATTRIBUTE_NODE : Node.ELEMENT_NODE);