title: Python framework for object-XML mapping through decorators?
body: <p>After coming up impressed with the ease of use of the XML serialization framework <a href="http://simple.sourceforge.net/" rel="nofollow">Simple</a> XML in Java, I've tried looking for a Python counterpart that would facilitate implementing classes and their XML serialization in a similar fashion. So far, I've come up more or less empty-handed, although there are interesting candidates (but none conveniently using <a href="https://wiki.python.org/moin/PythonDecorators" rel="nofollow">decorators</a>, as far as I could tell); for example, I started looking at <a href="https://pypi.python.org/pypi/dexml/" rel="nofollow">dexml</a>, but I got stumped with an example as simple as implementing a class that would allow deserialization of</p>
  
  <pre><code>&lt;Error Code="0"&gt;OK&lt;/Error&gt;
  </code></pre>
  
  <p>With Simple in Java, I could write a class such as </p>
  
  <pre><code>@Root(name="Error")
  public class Error {
  
      @Attribute(name = "Code")
      private int code;  // public getter and setter
  
      @Text(required = false) 
      private String description; // public getter and setter
  }
  </code></pre>
  
  <p>Is there already a similar flavored framework in Python as Simple for Java? I have preference for Python 2.6 support, although that's not mandatory; if it's supported only for Python 3 I'll also look into it.</p>