!
      write (6,*) "      ---> StartXML/pointingSubscans.f90 "
      write (6,*) "number of SS segment:   ", nSegments
      write (6,*) "number of OTF subscans: ", vars(iValue)%nOtf
!
      call pakoXMLwriteStartElement("RESOURCE","subscans",             &
     &                         comment="generated by paKo",            &
     &                         error=errorXML)
!
      do ii = 1, nSegments, 1
!
      call pakoXMLwriteStartElement("RESOURCE","subscan",              &
     &                         error=errorXML)
!
      call pakoXMLwriteElement("PARAM","type","otf",                   &
     &                         dataType="char",                        &
     &                         error=errorXML)
!
      write (valueC,*) "PROJECTION"
      call pakoXMLwriteElement("PARAM","systemOffset",valueC,          &
     &                         dataType="char",                        &
     &                         error=errorXML)
!
      call pakoXMLwriteStartElement("RESOURCE","segments",             &
     &                         error=errorXML)
!
      call pakoXMLwriteStartElement("RESOURCE","segment",              &
     &                         error=errorXML)
!
         write (valueC,*) ssList(ii)%segType
      call pakoXMLwriteElement("PARAM","type",valueC,                  &
     &                         dataType="char",                        &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%start%x*angleUnit)
      call pakoXMLwriteElement("PARAM","xStart",valueC,                &
     &                         "rad", "float",                         &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%start%y*angleUnit)
      call pakoXMLwriteElement("PARAM","yStart",valueC,                &
     &                         "rad", "float",                         &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%end%x*angleUnit)
      call pakoXMLwriteElement("PARAM","xEnd",valueC,                  &
     &                         "rad", "float",                         &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%end%y*angleUnit)
      call pakoXMLwriteElement("PARAM","yEnd",valueC,                  &
     &                         "rad", "float",                         &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%speedStart*speedUnit)
      call pakoXMLwriteElement("PARAM","speedStart",valueC,            &
     &                         "rad/s", "float",                       &
     &                         error=errorXML)
!
         write (valueC,*) real(ssList(ii)%speedEnd*speedUnit)
      call pakoXMLwriteElement("PARAM","speedEnd",valueC,              &
     &                         "rad/s", "float",                       &
     &                         error=errorXML)
!
      call pakoXMLwriteElement("PARAM","traceFlag","on",               &
     &                         dataType="char",                        &
     &                         error=errorXML)
!
      call pakoXMLwriteEndElement("RESOURCE","segment",                &
     &                         error=errorXML)
!
      call pakoXMLwriteEndElement("RESOURCE","segments",               &
     &                         error=errorXML)
!
      call pakoXMLwriteEndElement("RESOURCE","subscan",               &
     &                         error=errorXML)
!
      end do
!
      call pakoXMLwriteEndElement("RESOURCE","subscans",              &
     &                         error=errorXML)
!





