How to determine the resource type?

    if( DAV:resourcetype == DAV:version-history )
      type is VersionHistory
    
    else if( DAV:version-controlled-binding-set exists )
      type is FolderVersion
    
    else if( DAV:baseline-collection exists exists )
      type is Baseline
      
    else if( DAV:version-name exists )
      type is Version
      
    else if( DAV:resourcetype == DAV:collection AND DAV:workspace-checkout-set exists )
      type is Workspace
    
    else if( DAV:resourcetype == DAV:collection )
      type is Folder
      
    else if( DAV:baseline-controlled-collection exists )
      type is Configuration
      
    else if( DAV:resourcetype == DAV:activity )
      type is Activity
      
    else
      type is Resource
  