printElements($bag, $needsContents, $indent);
printAccessorsAndMutators($bag, $needsContents, $indent);
//VALUE
// NOTE: special casing any element with 'mixed' content model to ListOfInts type _value
if (($bag['content_type'] != '' || $bag['mixed']) && !$bag['abstract'] && !isset($bag['baseTypeViaRestriction'])) {
    print $indent . "protected:  // Value\n";
    $content_type = $bag['content_type'];
    $pre = '';
    getTypeNameAndPrefix($content_type, $pre);
    if ($bag['parent_meta']['inline_elements'] != NULL && array_key_exists($content_type, $bag['parent_meta']['inline_elements'])) {
        $pre = '::' . $pre;
    }
    print $indent . "\t/**\n" . $indent . "\t * The " . $pre . ucfirst($content_type) . " value of the text data of this element. ";
    print "\n" . $indent . "\t */\n";
    $valueType = $pre . ucfirst($content_type);
    if ($meta[$content_type]['isAComplexType']) {
        $valueType = $valueType . "Ref";
    }
    print $indent . "\t" . $valueType . " _value;\n";
}
//CONSTRUCTORS
printConstructors($full_element_name, $bag, $baseClass, $indent);
print "\n" . $indent . "public: // STATIC METHODS\n";
print $indent . "\t/**\n" . $indent . "\t * Creates an instance of this class and returns a daeElementRef referencing it.\n";
print $indent . "\t * @return a daeElementRef referencing an instance of this object.\n" . $indent . "\t */\n";
print $indent . "\tstatic DLLSPEC " . $_globals['meta_prefix'] . "ElementRef create(DAE& dae);\n";
print $indent . "\t/**\n" . $indent . "\t * Creates a daeMetaElement object that describes this element in the meta object reflection framework.";
print "\n" . $indent . "\t * If a daeMetaElement already exists it will return that instead of creating a new one. \n";
print $indent . "\t * @return A daeMetaElement describing this COLLADA element.\n" . $indent . "\t */\n";
print $indent . "\tstatic DLLSPEC " . $_globals['meta_prefix'] . "MetaElement* registerElement(DAE& dae);\n";
print $indent . "};\n\n";
}
//CONSTRUCTORS
if (!$bag['isAComplexType']) {
    printConstructors($full_element_name, $bag, $baseClasses, $indent);
} else {
    printConstructors($full_element_name . "_complexType", $bag, $baseClasses, $indent);
    print $indent . "};\n\n";
    print $indent . "/**\n" . $indent . " * An element of type " . $full_element_name . "_complexType.\n" . $indent . " */\n";
    print $indent . "class " . $full_element_name . " : public daeElement, public " . $full_element_name . "_complexType\n";
    print $indent . "{\n";
    print $indent . "public:\n";
    print $indent . "\tvirtual COLLADA_TYPE::TypeEnum getElementType() const { return COLLADA_TYPE::" . strtoupper($bag['element_name']) . "; }\n";
    print $indent . "\tstatic daeInt ID() { return " . $_globals['typeID']++ . "; }\n";
    print $indent . "\tvirtual daeInt typeID() const { return ID(); }\n";
    if ($_globals['accessorsAndMutators'] && ($bag['useXMLNS'] || count($bag['attributes']) > 0)) {
        //generate accessors and mutators for everything
        print "\n" . $indent . "public:\t//Accessors and Mutators\n";
        printAttributes($bag, $typemeta, $indent, true);
    }
    $dummy = array();
    printConstructors($full_element_name, $dummy, array("daeElement", $full_element_name . "_complexType"), $indent);
}
print "\n" . $indent . "public: // STATIC METHODS\n";
print $indent . "\t/**\n" . $indent . "\t * Creates an instance of this class and returns a daeElementRef referencing it.\n";
print $indent . "\t * @return a daeElementRef referencing an instance of this object.\n" . $indent . "\t */\n";
print $indent . "\tstatic DLLSPEC " . $_globals['meta_prefix'] . "ElementRef create(DAE& dae);\n";
print $indent . "\t/**\n" . $indent . "\t * Creates a daeMetaElement object that describes this element in the meta object reflection framework.";
print "\n" . $indent . "\t * If a daeMetaElement already exists it will return that instead of creating a new one. \n";
print $indent . "\t * @return A daeMetaElement describing this COLLADA element.\n" . $indent . "\t */\n";
print $indent . "\tstatic DLLSPEC " . $_globals['meta_prefix'] . "MetaElement* registerElement(DAE& dae);\n";
print $indent . "};\n\n";