Minor nullreference fix for datatypes

Some datatypes have a null as prevalue value. new XAttribute throws nullreference exception.
You should probably add an XAttribute factory replacing null values with empty string to avoid such cases.