Assuming "frame" refers to a nameplate:
Code:
local healthBar, castBar = frame:GetChildren()
local glowRegion, overlayRegion, highlightRegion, nameTextRegion, levelTextRegion, bossIconRegion, raidIconRegion, stateIconRegion = frame:GetRegions()
local _, castbarOverlay, shieldedRegion, spellIconRegion = castBar:GetRegions()
See any of the *Nameplates addons for more examples; the above was copied from
caelNameplates.