'Saves the lexicon as an XML-file.'

def save(self, path):

    a = []
    a.append('<?xml    version="1.0"    encoding="utf-8"?>')
    a.append('<sentiment>')
    for w in sorted(self):
        for (pos, (p, s, i)) in self[w].items():
            pos = (pos or '')
            if (pos or (len(self[w]) == 1)):
                a.append((' DCTB <word    %s    %s    %s    %s    %s    %s    />' % (('form="%s"' % w), ('pos="%s"' % pos), ('polarity="%.2f"' % p), ('subjectivity="%.2f"' % s), ('intensity="%.2f"' % i), ('label="%s"' % self.labeler.get(w, '')))))
    a.append('</sentiment>')
    f = open(path, 'w')
    f.write((codecs.BOM_UTF8 + encode_utf8('\n'.join(a))))
    f.close()
