Issue #1081 - XML DataContract Formatter can fail to write when instance type != declaredType.

Adding Functional tests appropriately.