This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have an application UI that uses XmlBeans to parse an XML document and display the parsed "XmlObjects" in a exploreresque treeview. XmlBeans doesn't provide much support for eventing so I am grabbing the "Document's" DomNode to employ DOM's eventing support. From there, I am getting the document's root element via getDocumentElement(). I then try to cast this element to EventTarget so I can add to the interface my org.w3c.dom.events.EventListener. However, a ClassCastException is occurring where the cast occurs from Element to EventTarget. Below is a snippet: