support xtype. Fixes issue #326