New library support in XUI 2.0 allows further separation of UI and business logic. Attributes and events no longer need to be implemented in classes derived from XPage. The new support even opens up the possibility of embedding support for scripting engines.
see: http://xoetrope.net/xui/Xui2Preview/libraryfunctions.php