This method of the ElementImpl class retrieves the number of attributes.
public int numAttributes();
Returns the number of attributes.