In XML, where you see
parentKey, that is convert to a key on the parent frame (funny that)
Code:
<Button parentKey="CloseButton" inherits="UIPanelCloseButtonDefaultAnchors"/>
Would become:
Lua Code:
frame.CloseButton = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
frame.CloseButton:SetPoint("TOPRIGHT", -4, -4)
Because the parent frame has a (not very unique) name you can access the child frame (CloseButton) via the parent's key
Lua Code:
SimpleFrame.CloseButton:Click()
would be the same as the mouse clicking the close button