bool RangeProfilePlotManager::serialize(SessionItemSerializer& serializer) const
{
   XMLWriter writer("RangeProfilePlotManager");
   writer.addAttr("viewId", mpView->getId());

#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : We should be able to save the plot's session id and restore " \
"using that but the PlotWidget is not really part of the session. The following code is a work around and should be changed " \
"when OPTICKS-542 is implemented. (tclarke)")

   writer.pushAddPoint(writer.addElement("plot"));
   Serializable* pPlotSer = dynamic_cast<Serializable*>(mpPlot); // The imp side is serializable
   VERIFY(pPlotSer);
   if (!pPlotSer->toXml(&writer))
   {
      return false;
   }
   writer.popAddPoint();
   writer.pushAddPoint(writer.addElement("plotView"));
   Serializable* pPlotViewSer = dynamic_cast<Serializable*>(mpView); // The imp side is serializable
   VERIFY(pPlotViewSer);
   if (!pPlotViewSer->toXml(&writer))
   {
      return false;
   }
   writer.popAddPoint();

   for (std::map<Signature*, std::string>::const_iterator sig = mSigPointSets.begin();
      sig != mSigPointSets.end(); ++sig)
   {
      writer.pushAddPoint(writer.addElement("signature"));
      writer.addAttr("sigId", sig->first->getId());
      writer.addAttr("pointSetName", sig->second);
      writer.popAddPoint();
   }

   if (!serializer.serialize(writer))
   {
      return false;
   }
   serializer.endBlock();
   return DockWindowShell::serialize(serializer);
}