title: How can i convert an xml file into JSON using python?
body: <p>I have an XML file which I want to convert into JSON file using python, but its nt working out for me.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;note&gt;
      &lt;to&gt;Tove&lt;/to&gt;
      &lt;from&gt;Jani&lt;/from&gt;
      &lt;heading&gt;Reminder&lt;/heading&gt;
      &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  </code></pre>
  
  <p>The above XML file I am parsing using ElementTree and giving it to Simplejson to serialize like this:</p>
  
  <pre><code>from xml.etree import ElementTree as ET
  import simplejson
  
  tree = ET.parse(Xml_file_path)
  simplejson.dumps(tree)
  </code></pre>
  
  <p>It gives me an error: TypeError: xml.etree.ElementTree.ElementTree object at 0x00C49DD0 is not JSON serializable.</p>