 		else
 			indent = ""
 			newline = ""
-		attrs = (" #{a}=\"#{@attributes[a]}\"" for a of @attributes).join('')
+		attrs = ((" #{a}=\"#{@attributes[a]}\"" if @attributes[a] isnt "") for a of @attributes).join('')
 		len = @childNodes.length
-		end = ""
-		if len is 0
-			end = "/"
+		end = switch len
+			when 0 then "/"
+			else ""
 		ret = [indent + "<#{name}#{attrs}#{end}>" + newline]
 		r = 1
 		if deep

		@nodeType = type
		@ownerDocument = ownerDocument
		@childNodes = []
		@attributes = {}
		@listeners =
			true: {}
			false: {}

			when Node.ELEMENT_NODE
				Element::toString.call @, pretty, deep, indentLevel
			when Node.ATTRIBUTE_NODE
				if @nodeValue isnt ""
					"#{indent}#{@nodeName}=\"#{@nodeValue}\""
			when Node.CDATA_SECTION_NODE
				"#{indent}<![CDATA[#{@nodeValue}]]>" + newline
			when Node.COMMENT_NODE
