public function toArray(core_kernel_classes_Class $clazz)
    {
        $returnValue = array();
        $properties = $clazz->getProperties(false);
        foreach ($clazz->getInstances(false) as $instance) {
            $data = array();
            foreach ($properties as $property) {
                $data[$property->getLabel()] = null;
                $values = $instance->getPropertyValues($property);
                if (count($values) > 1) {
                    $data[$property->getLabel()] = $values;
                } elseif (count($values) == 1) {
                    $data[$property->getLabel()] = $values[0];
                }
            }
            array_push($returnValue, $data);
        }
        return (array) $returnValue;
    }