First draft, works in a limited fashion.
Has problems with spaces inside attributes.
Has problems with spaces inside text elements.