I've tried to do some thing differently from Jonas and Torgeir.
Some notes:
- I've used 1.9 hash syntax
- I've tried to remove most variables, and use methods instead (I like reading
xml
instead of@xml
) - I don't like the fact that I have to
join
the result, as it's now an array, not a string - I tried to use a block to handle indentation
Does it work with hyphenated xml element names?