def exportXMLBinding(self, sio=StringIO(), newl=VDEX_EXPORT_NEWL, addindent=VDEX_EXPORT_INDENT):
        """
        exports whole vocabulary as IMS VDEX compliant XML
        """

        # prepare minidom
        minidom =getDOMImplementation('minidom')
        doc=minidom.createDocument('', 'vdex', '')

        # build vdex base
        elroot = xml.getChildrenByTagName(doc,'vdex')[0]

        # attributes on base
        xml.setAttr(doc,elroot,'profileType',self.getProfileType())
        xml.setAttr(doc,elroot,'xmlns',
                    'http://www.imsglobal.org/xsd/imsvdex_v1p0')
        if self.getOrderSignificant():
            xml.setAttr(doc,elroot,'orderSignificant',self.getOrderSignificant())
        if self.getRegistrationStatus():
            xml.setAttr(doc,elroot,'isRegistered',self.getRegistrationStatus())
        if self.getDefaultLanguage():
            xml.setAttr(doc,elroot,'language',self.getDefaultLanguage())

        # node id
        xml.appendText(doc,elroot,'vocabIdentifier',self.getVocabularyIdentifier() or self.absolute_url())

        # node name with langstring
        elname=xml.appendNode(doc,elroot,'vocabName')
        for langstring in self.contentValues():
            if langstring.meta_type == "VdexLangstring":
                langnode=langstring.getDOMBindingNode(doc)
                elname.appendChild(langnode)

        # all term node
        for term in self.contentValues():
            if term.meta_type == "VdexTerm":
                node=term.getDOMBindingNode(doc)
                elroot.appendChild(node)

        # all realtionship nodes
        for rel in self.contentValues():
            if rel.meta_type == "VdexRelationship":
                node=rel.getDOMBindingNode(doc)
                elroot.appendChild(node)

        doc.writexml(sio, newl='\n', addindent='\t')
        return sio
    def getDOMBindingNode(self, doc):
        """
        returns a dom-element containing its and all it subobjects dom
        representation
        """
        node=doc.createElement('term')
        if self.getOrderSignificant():
            xml.setAttr(doc,node,'orderSignificant',self.getOrderSignificant())
        xml.appendText(doc,node,'termIdentifier',self.getTermKey())

        # caption
        langstrings=self._getLangstrings('caption')
        if langstrings:
            captionnode=xml.appendNode(doc,node,'caption')
            for langstring in langstrings:
                langnode=langstring.getDOMBindingNode(doc)
                captionnode.appendChild(langnode)

        # description
        langstrings=self._getLangstrings('description')
        if langstrings:
            descrnode=xml.appendNode(doc,node,'description')
            for langstring in langstrings:
                langnode=langstring.getDOMBindingNode(doc)
                descrnode.appendChild(langnode)

        # all media descriptor nodes
        for media in self.contentValues():
            if media.meta_type == "VdexMediaDescriptor":
                medianode=media.getDOMBindingNode(doc)
                node.appendChild(medianode)

        # all sub term nodes
        for term in self.contentValues():
            if term.meta_type == "VdexTerm":
                termnode=term.getDOMBindingNode(doc)
                node.appendChild(termnode)

        return node