The designator lastChild refers to the last immediate child of the current note. For example:
I. A note
Ia. Another Note
Ib. Yet Another Note
II. Some Note
IIc. Subsidiary stuff
III. Different stuff
IV. More Stuff
The lastChild of I is Ib. The lastChild of II is IIc. III has no lastChild.
The logical opposite of lastChild - i.e. the first child - is child [sic].
Designators don't allow offset references as with attributes. Thus $Name("Some note") works but child("Some note") doesn't. If an offset designator is needed use find() instead.