How would you do with simple-xml if needed to have attributes inside command or result elements?:
config command name="X"> com1 /command> result name="Y"> res1 /result> command name="A"> com2 /command> result name="B"> res2 /result> /config>