Mapping of XML datatypes to PHP Classes with validation