It is very convenient to have tidy installed if you use the embedHTML method.
Depending on the XML parser carriage returns are sometimes interpreted as nodes, tidy takes care automatically of all those issues.
Moreover the extra spacing with addHTML methos has been solved since v 3.3.