less brittle XML parsing in Python, Ruby proof of concept