[BUG-FIX]: elements with only text nodes

If each text node in the element contains white spaces then at the time
of printing it would print a space. This new form joins all the text
elements and prints the result by removing the extra spaces.