views:

93

answers:

1
<things>
    <fruit>apple</fruit>
    <hardware>mouse</hardware>
...
</things>

Turn it into:

{'things':[{'fruit':'apple'}, {'hardware':'mouse'}]}

Is there an easy way to do this? Thanks.

+1  A: 

there's a nice recipe for that here:

http://code.activestate.com/recipes/570085/

another good one is here:

http://code.activestate.com/recipes/522991/