Fixed nulls; XML now conforms to SQL schema