If I have a dataset I would like to upload into XNAT, and I've properly organized the data on the file system, then uploading the data is very easy.
For our hypothetical situation, I'm uploading a collection of data, each including a T1 and T2 raw DICOM data as well as NIFTI reconstrutions of that data. I have it organized by project/subject/session.
I can build a simple script which will translate this directory into a set of REST commands.
When uploading images, it is good form to define the format of the images (DICOM, ANALYZE, etc) and the content type of the data.
Related: REST Uploading Files Tips