code: @Override
      public NodeInfo selectID(final String ID, final boolean getParent) {
          try {
              final INodeReadTrx rtx =
                  new NodeReadTrx(mSession.beginBucketRtx(mSession.getMostRecentVersion()));
              final AbsAxis axis = new DescendantAxis(rtx, true);
              while (axis.hasNext()) {
                  if (rtx.getNode().getKind() == IConstants.ELEMENT) {
                      final int attCount = ((ElementNode)rtx.getNode()).getAttributeCount();
  
                      if (attCount > 0) {
                          final long nodeKey = rtx.getNode().getDataKey();
  
                          for (int index = 0; index < attCount; index++) {
                              rtx.moveToAttribute(index);
  
                              if ("xml:id".equalsIgnoreCase(rtx.getQNameOfCurrentNode().getLocalPart())
                                  && ID.equals(rtx.getValueOfCurrentNode())) {
                                  if (getParent) {
                                      rtx.moveTo(rtx.getNode().getParentKey());
                                  }
                                  return new NodeWrapper(this, rtx.getNode().getDataKey());
                              }
                              rtx.moveTo(nodeKey);
                          }
                      }
                  }
                  axis.next();
              }
              rtx.close();
          } catch (final TTException exc) {
              LOGGER.error(exc.toString());
          }
          return null;
      }
docs: {@inheritDoc}