public static PLInstance makePlInstance(LogicObject instance) {
    { PLInstance xmlinstance = PLInstance.new_PLInstance();

      xmlinstance.InstanceName = GuiServer.xmlifyString(GuiServer.plObjectToGuiName(instance));
      if (instance.homeModule() != null) {
        xmlinstance.Module = instance.homeModule().moduleFullName;
      }
      else {
        xmlinstance.Module = "";
      }
      xmlinstance.SourceString = "(DEFOBJECT " + xmlinstance.InstanceName + ")";
      return (xmlinstance);
    }
  }