code: public final int getFirstAttribute(int nodeHandle)
    {
      int nodeID = makeNodeIdentity(nodeHandle);
  
      if (nodeID == DTM.NULL)
        return DTM.NULL;
  
      int type = _type2(nodeID);
  
      if (DTM.ELEMENT_NODE == type)
      {
        // Assume that attributes and namespaces immediately follow the element.
        while (true)
        {
          nodeID++;
  	// Assume this can not be null.
  	type = _type2(nodeID);
  
  	if (type == DTM.ATTRIBUTE_NODE)
  	{
  	  return makeNodeHandle(nodeID);
  	}
  	else if (DTM.NAMESPACE_NODE != type)
  	{
  	  break;
  	}
        }
      }
  
      return DTM.NULL;
    }
docs: The optimized version of DTMDefaultBase.getFirstAttribute().
  <p>
  Given a node handle, get the index of the node's first attribute.
  
  @param nodeHandle int Handle of the node.
  @return Handle of first attribute, or DTM.NULL to indicate none exists.