Extension functions inside class

Thanks.

Followup: is there a way to write an extension function for a class that is itself an extension function?  In other words, to add B.ext() to A after A is defined elsewhere.  I tried syntax like fun A.B.ext() {...} but it didn’t parse.

The use case: I’m copying the example HTML builders [1] for use in Javascript, building the DOM. That example defines String.plus as an extension function inside the Element class. But in my variation I’m using the existing org.w3c.dom.Element class (and it’s subclasses HTMLDivElement, etc).  If I put String.plus outside that class, it’s available everywhere which isn’t ideal.

Rob

[1] http://kotlinlang.org/docs/reference/type-safe-groovy-builders.html