Templating: helper nl2br recognises xhtml settings

Pull for #584