Hey Dan,
Interesting thought.
Here's how it looks in Script Debugger.
tell application "System Events"
tell application process "TextEdit"
front window
end tell
end tell
I'm not going to fiddle with transforming it to XML at the moment, but I have an osax that might make that easy – so I'll think about it.
I'm not aware of any freeware hierarchical viewers for the Mac other than Xcode. I have a great utility called PlistEdit Pro that's much lighter weight than Xcode (but also more expensive).
-Chris