Thanks again! That worked a treat. A small nit to pick: Kid introduces a newline between the open and close script tags. But that's merely a nit.
I'm also pleased to see it leaves the case of attributes alone. My JavaScript binding framework (think Apple's Cocoa Bindings for Web applications) uses custom attributes to do its trick. At some point, these will be converted to use a namespace, but I haven't had the time.

