[xmlutils] validate dates before writing them to XML
read/write dateadded uisng XMLUtils
Merge pull request #3736 from jmarshallnz/xml_date_time

Only write dates/date times to XML if they're valid - fixes #14159