The attribute gml:id supports provision of a handle for the XML element representing a GML Object. Its use is mandatory for all GML objects. It is of XML type ID, so is constrained to be unique in the XML document within which it occurs.
Source
<complexType name="NodeType"><complexContent><extension base="gml:AbstractTopoPrimitiveType"><sequence><element name="container" type="gml:FaceOrTopoSolidPropertyType" minOccurs="0"/><element ref="gml:directedEdge" minOccurs="0" maxOccurs="unbounded"><annotation><documentation>In the case of planar topology, a gml:Node must have a clockwise sequence of gml:directedEdge properties, to ensure a lossless topology representation as defined by Kuijpers, et. al. (see OGC 05-102 Topology IPR).</documentation></annotation></element><element ref="gml:pointProperty" minOccurs="0"/></sequence><attributeGroup ref="gml:AggregationAttributeGroup"/></extension></complexContent></complexType>