def checkParsed(self, input, expected, beExtremelyLenient=1):
        """
        Check that C{input}, when parsed, produces a DOM where the XML
        of the document element is equal to C{expected}.
        """
        output = microdom.parseString(input,
                                      beExtremelyLenient=beExtremelyLenient)
        self.assertEqual(output.documentElement.toxml(), expected)

        Check that C{input}, when parsed, produces a DOM where the XML
        of the document element is equal to C{expected}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_xml.py