- casting problem when converting to XML