$parent is a key that gets replaced by the name of that widget's parent.
I don't use XML, so this is just some generic pseudo-code, but I think you'll get the gist.
Code:
<Frame="MyFrame">
<Button="$parentButton">
<Scripts>
<OnClick>--dostuff</OnClick>
</Scripts>
</Button>
</Frame>
The button's name is MyFrameButton.
To get the name of something's parent via Lua, you do widget:GetParent().
/edit: heh - Xrystal and I used the same example!
/edit2: note - $parent only works in XML, not Lua.