DS-1444 XMLUI XHTML validity fixes

For convenience, this is the patch from the Jira issue by Denis Fdz. I haven't done any testing yet.