xmldiver.h: Include sys/stat header
xd_doc: Add _xd_isdir private method
xd_doc: xd_load checks if file is a directory