Escape characters in XMLLayout and HTMLLayout

Fix LOGBACK-728 and LOGBACK-440.

Add unit test for XMLLayout: validate against log4j.dtd.