How to query data in Set?

I am trying to query the content in a Set.
I want to know if the Set contains only
Poly, Vertex, Face, Edge, UV, etc.
Is it possible to do it in MEL??

This is what I have tried:

// Get a list of all Sets.
string $allSets[] = ls -sets;

for( $possibleSet in $allSets )
{
// Is this a Quick Set??
if (nodeType UVSet == "objectSet")
{
// This is a Set.... But how do I
// find out if it has the following:
// Poly,Vertex,Face,Edge,UV...etc
...
}
}

My purpose is to write (yet another) Set manager,
but mainly to assist myself in Poly modelling.

(This is the first time I'm looking into MEL)

kimc.