for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType')
where $x[./RESOURCE_PROFILE/BODY/CONFIGURATION/context/@type = 'community' or ./RESOURCE_PROFILE/BODY/CONFIGURATION/context/@type = 'ri']
return $x
