title: Python object serialization to XML & deserialization from XML
body: <p>How I can serialize instance of class to XML file and deserialize back?</p>
  
  <hr>
  
  <p>For example.</p>
  
  <p>I have class "Cat":</p>
  
  <pre><code>class Cat:
      __name=''
      __age=0
      __tail_length=0
      __weight=0
  
      def __init__(self, name, age, tail_length, weight):
          self.__name=name
          self.__age=age
          self.__tail_length=tail_length
          self.__weight=weight
  </code></pre>
  
  <p>Is possible make that?</p>
  
  <pre><code>timon=Cat(name='Timon', age=3, tail_length=20, weight=18)
  magic_xml_serializer.serialize(destfile='cat-timon.xml', obj=timon)
  del(timon)
  timon=magic_xml_serializer.deserialize(sourcefile='cat-timon.xml')
  print ('yes','no')[type(timon)=='Cat'] #yes
  </code></pre>
  
  <p>If it's possible to do, please write me how. Or just give me link with examples of code. Thanks!</p>
  
  <p><em>P.S. Python version 2.7</em></p>