We could avoid a bunch of backshashes by slightly smarter use of quotes, e.g.
```
echo '      <failure type = "'$RESULT\"
```