title: Mapping C structure to an XML element
body: <p>Suppose I have a structure in C or C++, such as:</p>
  
  <pre><code>struct ConfigurableElement {
     int ID;
     char* strName;
     long prop1;
     long prop2;
     ...
  };
  </code></pre>
  
  <p>I would like to load/save it to/from the following XML element:</p>
  
  <pre><code> &lt;ConfigurableElement ID="1" strName="namedElem" prop1="2" prop2="3" ... /&gt;
  </code></pre>
  
  <p>Such a mapping can be trivially done in Java/C# or any other language with run-time reflection for the matter. Can it be done in any non-tedious way in C++ with macros/template trickery?</p>
  
  <p>Bonus points for handling nested structures/unions.</p>