code: protected int getFirstAttributeIdentity(int identity) {
      int type = _type(identity);
  
      if (DTM.ELEMENT_NODE == type)
      {
        // Assume that attributes and namespaces immediately follow the element.
        while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
        {
  
          // Assume this can not be null.
          type = _type(identity);
  
          if (type == DTM.ATTRIBUTE_NODE)
          {
            return identity;
          }
          else if (DTM.NAMESPACE_NODE != type)
          {
            break;
          }
        }
      }
  
      return DTM.NULL;
    }
docs: Given a node identity, get the index of the node's first attribute.
  
  @param identity int identity of the node.
  @return Identity of first attribute, or DTM.NULL to indicate none exists.