StringBuffer replaced by StringBuilder; bugfix for removing new line characters

This pull request contains: 
- change - StringBuilder is preferred over StringBuffer - usage of StringBuffer is replaced by StringBuilder
- bugfix - new line characters in text of an XML element were removed when these new lines were between XML escape entities