replace stringbuffer by stringbuilder
fix: tags should be written as lowercase