Is there anyway to iterate through a element's attributes without knowing beforehand how many or what attributes an element will have?
For example: <object name="Apple" type="Fruit" state="Vermont"/> <object name="Orange" /> I'd want to make some kind of json from this, with the Apple object having values for attributes type and state, and the Orange object just having a value for "name".