Simple parsing and printing of tags
Fixed bug with end tag.