You need to include the XHP library, which you can find here. This defines the :xhp base class as well as all the HTML classes. Put all three files somewhere in your source tree then include init.php before doing anything with XHP.
There's currently a discussion going on in the HHVM.dev group on Facebook about if the library should be included by default or not, which you can view at https://www.facebook.com/groups/hhvm.dev/229787297210377/.