My tinyXML attempt: ideone.com/yC1l8

(still not working)