In essence, last() evaluates to the number of nodes that match a certain XPath pattern, up to the point where last() appears, so if I had this XML:
<animals>
<cat>
<name>Felix</name>
</cat>
<dog>
<name>Fido</name>
</dog>
<cat>
<name>Paws</name>
</cat>
<dog>
<name>Fido</name>
</dog>
</animals>
In the expression
/animals/cat[last()]/name
last() would evaluate to 2 (because there are two nodes that match the pattern /animals/cat), and the XPath above would select the <name> node with the value Paws.
For this reason, .[last()] doesn't make a lot of sense, because . is always the current node, and only the current node.
If you want to select the last sibling of a certain node, try going one step up the tree and back down again:
../my:nodeName[last()]
or using the following-sibling axis:
following-sibling::my:nodeName[last()]