Write correct vr values when writing DICOM files
Sort elements when writing sequences