Given xml that looks like this:
<Store>
<foo>
<book>
<isbn>123456</isbn>
</book>
<title>XYZ</title>
<checkout>no</checkout>
</foo>
<bar>
<book>
<isbn>7890</isbn>
</book>
<title>XYZ2</title>
<checkout>yes</checkout>
</bar>
</Store>
I am getting this as my parsed xmldoc:
>>> from xml.dom import minidom
>>> xmldoc = minidom.parse('bar.xml')
>>> xmldoc.toxml()
u'<?xml version="1.0" ?><Store>\n<foo>\n<book>\n<isbn>123456</isbn>\n</book>\n<t
itle>XYZ</title>\n<checkout>no</checkout>\n</foo>\n<bar>\n<book>\n<isbn>7890</is
bn>\n</book>\n<title>XYZ2</title>\n<checkout>yes</checkout>\n</bar>\n</Store>'
Is there an easy way to pre-process this document so that when it is parsed, it isn't parsed as a single xml element?