def _embedparser(self, tree, XMLparser='xml.sax'):

         """
         Returns a correctly parsed chunk of valid xml according to the parsing
         libraries it relies on (currently it relies on xml.sax only)

         """

         from xml.sax.handler import ContentHandler
         if XMLparser == 'xml.sax':import xml.sax
         pstring = tree;TempHandler = ContentHandler()
         try:
            do_parse = xml.sax.parseString(pstring,TempHandler)
         except:
            return False
         return True

         Returns a correctly parsed chunk of valid xml according to the parsing
         libraries it relies on (currently it relies on xml.sax only)

         
recipes/Python/498101_Simpliest_XML_generator/recipe-498101.py