Index: src/sas/sasgui/perspectives/fitting/pagestate.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/pagestate.py	(revision c8e19964f2dda929ccae8237e7b140a906cdf134)
+++ src/sas/sasgui/perspectives/fitting/pagestate.py	(revision 83c09af62d5011f226defc52e4715b83e6494e0f)
@@ -1034,249 +1034,4 @@
             return self._read_cansas(path)
 
-    def _data2d_to_xml_doc(self, datainfo):
-        """
-        Create an XML document to contain the content of a Data2D
-
-        :param datainfo: Data2D object
-
-        """
-        if not issubclass(datainfo.__class__, Data2D):
-            raise RuntimeError, "The cansas writer expects a Data2D instance"
-
-        title = "cansas1d/%s" % self.version
-        title += "http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd"
-        doc = xml.dom.minidom.Document()
-        main_node = doc.createElement("SASroot")
-        main_node.setAttribute("version", self.version)
-        main_node.setAttribute("xmlns", "cansas1d/%s" % self.version)
-        main_node.setAttribute("xmlns:xsi",
-                               "http://www.w3.org/2001/XMLSchema-instance")
-        main_node.setAttribute("xsi:schemaLocation", title)
-
-        doc.appendChild(main_node)
-
-        entry_node = doc.createElement("SASentry")
-        main_node.appendChild(entry_node)
-
-        write_node(doc, entry_node, "Title", datainfo.title)
-        if datainfo is not None:
-            write_node(doc, entry_node, "data_class",
-                       datainfo.__class__.__name__)
-        for item in datainfo.run:
-            runname = {}
-            if item in datainfo.run_name and \
-                            len(str(datainfo.run_name[item])) > 1:
-                runname = {'name': datainfo.run_name[item]}
-            write_node(doc, entry_node, "Run", item, runname)
-        # Data info
-        new_node = doc.createElement("SASdata")
-        entry_node.appendChild(new_node)
-        for item in LIST_OF_DATA_2D_ATTR:
-            element = doc.createElement(item[0])
-            element.setAttribute(item[0], str(getattr(datainfo, item[1])))
-            new_node.appendChild(element)
-
-        for item in LIST_OF_DATA_2D_VALUES:
-            root_node = doc.createElement(item[0])
-            new_node.appendChild(root_node)
-            temp_list = getattr(datainfo, item[1])
-
-            if temp_list is None or len(temp_list) == 0:
-                element = doc.createElement(item[0])
-                element.appendChild(doc.createTextNode(str(temp_list)))
-                root_node.appendChild(element)
-            else:
-                for value in temp_list:
-                    element = doc.createElement(item[0])
-                    element.setAttribute(item[0], str(value))
-                    root_node.appendChild(element)
-
-        # Sample info
-        sample = doc.createElement("SASsample")
-        if datainfo.sample.name is not None:
-            sample.setAttribute("name", str(datainfo.sample.name))
-        entry_node.appendChild(sample)
-        write_node(doc, sample, "ID", str(datainfo.sample.ID))
-        write_node(doc, sample, "thickness", datainfo.sample.thickness,
-                   {"unit": datainfo.sample.thickness_unit})
-        write_node(doc, sample, "transmission", datainfo.sample.transmission)
-        write_node(doc, sample, "temperature", datainfo.sample.temperature,
-                   {"unit": datainfo.sample.temperature_unit})
-
-        for item in datainfo.sample.details:
-            write_node(doc, sample, "details", item)
-
-        pos = doc.createElement("position")
-        written = write_node(doc, pos, "x", datainfo.sample.position.x,
-                             {"unit": datainfo.sample.position_unit})
-        written = written | write_node(doc, pos, "y",
-                                       datainfo.sample.position.y,
-                                       {"unit": datainfo.sample.position_unit})
-        written = written | write_node(doc, pos, "z",
-                                       datainfo.sample.position.z,
-                                       {"unit": datainfo.sample.position_unit})
-        if written:
-            sample.appendChild(pos)
-
-        ori = doc.createElement("orientation")
-        written = write_node(doc, ori, "roll", datainfo.sample.orientation.x,
-                             {"unit": datainfo.sample.orientation_unit})
-        written = written | write_node(doc, ori, "pitch",
-                                       datainfo.sample.orientation.y,
-                                       {"unit":
-                                            datainfo.sample.orientation_unit})
-        written = written | write_node(doc, ori, "yaw",
-                                       datainfo.sample.orientation.z,
-                                       {"unit":
-                                            datainfo.sample.orientation_unit})
-        if written:
-            sample.appendChild(ori)
-
-        # Instrument info
-        instr = doc.createElement("SASinstrument")
-        entry_node.appendChild(instr)
-
-        write_node(doc, instr, "name", datainfo.instrument)
-
-        #   Source
-        source = doc.createElement("SASsource")
-        if datainfo.source.name is not None:
-            source.setAttribute("name", str(datainfo.source.name))
-        instr.appendChild(source)
-
-        write_node(doc, source, "radiation", datainfo.source.radiation)
-        write_node(doc, source, "beam_shape", datainfo.source.beam_shape)
-        size = doc.createElement("beam_size")
-        if datainfo.source.beam_size_name is not None:
-            size.setAttribute("name", str(datainfo.source.beam_size_name))
-        written = write_node(doc, size, "x", datainfo.source.beam_size.x,
-                             {"unit": datainfo.source.beam_size_unit})
-        written = written | write_node(doc, size, "y",
-                                       datainfo.source.beam_size.y,
-                                       {"unit": datainfo.source.beam_size_unit})
-        written = written | write_node(doc, size, "z",
-                                       datainfo.source.beam_size.z,
-                                       {"unit": datainfo.source.beam_size_unit})
-        if written:
-            source.appendChild(size)
-
-        write_node(doc, source, "wavelength", datainfo.source.wavelength,
-                   {"unit": datainfo.source.wavelength_unit})
-        write_node(doc, source, "wavelength_min",
-                   datainfo.source.wavelength_min,
-                   {"unit": datainfo.source.wavelength_min_unit})
-        write_node(doc, source, "wavelength_max",
-                   datainfo.source.wavelength_max,
-                   {"unit": datainfo.source.wavelength_max_unit})
-        write_node(doc, source, "wavelength_spread",
-                   datainfo.source.wavelength_spread,
-                   {"unit": datainfo.source.wavelength_spread_unit})
-
-        #   Collimation
-        for item in datainfo.collimation:
-            coll = doc.createElement("SAScollimation")
-            if item.name is not None:
-                coll.setAttribute("name", str(item.name))
-            instr.appendChild(coll)
-
-            write_node(doc, coll, "length", item.length,
-                       {"unit": item.length_unit})
-
-            for apert in item.aperture:
-                ap = doc.createElement("aperture")
-                if apert.name is not None:
-                    ap.setAttribute("name", str(apert.name))
-                if apert.type is not None:
-                    ap.setAttribute("type", str(apert.type))
-                coll.appendChild(ap)
-
-                write_node(doc, ap, "distance", apert.distance,
-                           {"unit": apert.distance_unit})
-
-                size = doc.createElement("size")
-                if apert.size_name is not None:
-                    size.setAttribute("name", str(apert.size_name))
-                written = write_node(doc, size, "x", apert.size.x,
-                                     {"unit": apert.size_unit})
-                written = written | write_node(doc, size, "y", apert.size.y,
-                                               {"unit": apert.size_unit})
-                written = written | write_node(doc, size, "z", apert.size.z,
-                                               {"unit": apert.size_unit})
-                if written:
-                    ap.appendChild(size)
-
-        #   Detectors
-        for item in datainfo.detector:
-            det = doc.createElement("SASdetector")
-            written = write_node(doc, det, "name", item.name)
-            written = written | write_node(doc, det, "SDD", item.distance,
-                                           {"unit": item.distance_unit})
-            written = written | write_node(doc, det, "slit_length",
-                                           item.slit_length,
-                                           {"unit": item.slit_length_unit})
-            if written:
-                instr.appendChild(det)
-
-            off = doc.createElement("offset")
-            written = write_node(doc, off, "x", item.offset.x,
-                                 {"unit": item.offset_unit})
-            written = written | write_node(doc, off, "y", item.offset.y,
-                                           {"unit": item.offset_unit})
-            written = written | write_node(doc, off, "z", item.offset.z,
-                                           {"unit": item.offset_unit})
-            if written:
-                det.appendChild(off)
-
-            center = doc.createElement("beam_center")
-            written = write_node(doc, center, "x", item.beam_center.x,
-                                 {"unit": item.beam_center_unit})
-            written = written | write_node(doc, center, "y",
-                                           item.beam_center.y,
-                                           {"unit": item.beam_center_unit})
-            written = written | write_node(doc, center, "z",
-                                           item.beam_center.z,
-                                           {"unit": item.beam_center_unit})
-            if written:
-                det.appendChild(center)
-
-            pix = doc.createElement("pixel_size")
-            written = write_node(doc, pix, "x", item.pixel_size.x,
-                                 {"unit": item.pixel_size_unit})
-            written = written | write_node(doc, pix, "y", item.pixel_size.y,
-                                           {"unit": item.pixel_size_unit})
-            written = written | write_node(doc, pix, "z", item.pixel_size.z,
-                                           {"unit": item.pixel_size_unit})
-            if written:
-                det.appendChild(pix)
-
-            ori = doc.createElement("orientation")
-            written = write_node(doc, ori, "roll", item.orientation.x,
-                                 {"unit": item.orientation_unit})
-            written = written | write_node(doc, ori, "pitch",
-                                           item.orientation.y,
-                                           {"unit": item.orientation_unit})
-            written = written | write_node(doc, ori, "yaw", item.orientation.z,
-                                           {"unit": item.orientation_unit})
-            if written:
-                det.appendChild(ori)
-
-        # Processes info
-        for item in datainfo.process:
-            node = doc.createElement("SASprocess")
-            entry_node.appendChild(node)
-
-            write_node(doc, node, "name", item.name)
-            write_node(doc, node, "date", item.date)
-            write_node(doc, node, "description", item.description)
-            for term in item.term:
-                value = term['value']
-                del term['value']
-                write_node(doc, node, "term", value, term)
-            for note in item.notes:
-                write_node(doc, node, "SASprocessnote", note)
-        # Return the document, and the SASentry node associated with
-        # the data we just wrote
-        return doc, entry_node
-
     def _parse_state(self, entry):
         """
@@ -1745,11 +1500,6 @@
             state.data.run_name[0] = state.data.name
 
-        if issubclass(state.data.__class__,
-                      sas.sascalc.dataloader.data_info.Data1D):
-            data = state.data
-            doc, sasentry = self._to_xml_doc(data)
-        else:
-            data = state.data
-            doc, sasentry = self._data2d_to_xml_doc(data)
+        data = state.data
+        doc, sasentry = self._to_xml_doc(data)
 
         if state is not None:
