code: protected int getTypedAttribute(int nodeHandle, int attType) {
      int type = getNodeType(nodeHandle);
      if (DTM.ELEMENT_NODE == type) {
        int identity = makeNodeIdentity(nodeHandle);
  
        while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
        {
          type = _type(identity);
  
          if (type == DTM.ATTRIBUTE_NODE)
          {
            if (_exptype(identity) == attType) return makeNodeHandle(identity);
          }
          else if (DTM.NAMESPACE_NODE != type)
          {
            break;
          }
        }
      }
  
      return DTM.NULL;
    }
docs: Given a node handle and an expanded type ID, get the index of the node's
  attribute of that type, if any.
  
  @param nodeHandle int Handle of the node.
  @param attType int expanded type ID of the required attribute.
  @return Handle of attribute of the required type, or DTM.NULL to indicate
  none exists.