Thanks for reporting the problem.
It'll be nice if you provide a small repro for this bug.
DataSet class doesn't have direct method that creates XmlDocument from it
and error can depend on how you doing this.

Signature
Sergey
-------
This posting is provided "AS IS" with no warranties, and confers no rights.
> I have WebService that returns
> XmlDocument. I made that XmlDocument from DataSet, but when DataSet is empty
[quoted text clipped - 3 lines]
> document. ---> System.NullReferenceException: Object reference not set to an
> instance of an object...so how I can avoid this error?