diff --git a/.gitattributes b/.gitattributes
index bb24505075b3b7f9d039771f642db0652291227d..d404369db9686d751bb21f52a510761c511327a0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5915,6 +5915,7 @@ SAS/XML_generator/test/test_regression.in_data/txt/old_pulsar_pipe_test.txt -tex
 SAS/XML_generator/test/test_regression.in_data/txt/test_LB.txt -text
 SAS/XML_generator/test/test_regression.in_data/txt/test_input.txt -text
 SAS/XML_generator/test/test_regression.in_data/txt/test_input_cep4.txt -text
+SAS/XML_generator/test/test_regression.in_data/txt/test_input_commensal_obs_DRAGNET.txt -text
 SAS/XML_generator/test/test_regression.in_data/txt/test_input_long_baseline_pipeline.txt -text
 SAS/XML_generator/test/test_regression.in_data/xml/20150713_4C17.31.xml -text
 SAS/XML_generator/test/test_regression.in_data/xml/20150731_G46_run1_HBA.xml -text
diff --git a/SAS/XML_generator/test/test_regression.in_data/txt/test_input_commensal_obs_DRAGNET.txt b/SAS/XML_generator/test/test_regression.in_data/txt/test_input_commensal_obs_DRAGNET.txt
new file mode 100644
index 0000000000000000000000000000000000000000..565836933de41a77251860aea931254420430c4c
--- /dev/null
+++ b/SAS/XML_generator/test/test_regression.in_data/txt/test_input_commensal_obs_DRAGNET.txt
@@ -0,0 +1,78 @@
+projectName=test_lofar                  # be careful! Don't make typos here. Or otherwise a non-valid project will be created in mom
+mainFolderName=xmlgen_commensal_test           # the name of the folder that will contain all blocks, if left unspecified no main folder will be created
+mainFolderDescription=Commensal Observation DRAGNET (XMLgenerator test)
+
+BLOCK
+
+cluster=DRAGNET
+split_targets = F                       # true:create a separate target observation for every target (beam) line or false:combine them in a multi-beam observation
+calibration = none                      # internal / external / none
+processing=none                         # can be one of Calibration, Preprocessing, Imaging, Pulsar, LongBaseline, none
+imagingPipeline=none                    # can be one of MSSS, standard, none
+repeat=1                                # the number of repeats of this block
+
+packageName=commensalobs-DRAGNET        # the name that will be given to the package folder that contains this block's observation and pipelines
+packageDescription=Commensal Obs package description
+packageTag=                             # optional tag that will be prepended before every observation and pipeline name/description (Max 8 characters).
+
+antennaMode=HBA Dual
+clock=200 MHz
+instrumentFilter=110-190 MHz
+numberOfBitsPerSample=8
+integrationTime=4.0
+channelsPerSubband=16
+stationList=core                        # comma-separated list of station names and/or the following aliasses: core, superterp, remote, international, all, nl
+tbbPiggybackAllowed=T
+aartfaacPiggybackAllowed=T
+
+###### Which data types should be produced: ######
+correlatedData=T
+coherentStokesData=T
+incoherentStokesData=T
+flysEye=F
+coherentDedisperseChannels=False
+
+###### Coherent Stokes parameters ######
+subbandsPerFileCS=20
+numberCollapsedChannelsCS=16
+stokesDownsamplingStepsCS=6
+whichCS=XXYY
+
+###### Incoherent Stokes parameters ######
+subbandsPerFileIS=40
+numberCollapsedChannelsIS=1
+stokesDownsamplingStepsIS=12
+whichIS=I
+
+#calibratorDuration_s=120                # duration of calibration observations in seconds
+targetDuration_s=600                    # duration of target observations in seconds
+
+###### Globals are used when a target/calibration line does not have its own specific parameter specified for that property ######
+#Global_TAB=
+#Global_TABrings=2;0.1                   # nr of tabrings and tabring size
+#Global_Pulsar=B0329+54;T;T;DSPSR EXTRA OPTIONS;PREPDATA;5.1;-2;F;F;F;F;F;2BF2FITS;4;101;RFI FIND EXTRA OPTIONS;PREPFOLD EXTRA;PREPSUBBAND Extra; 0.6;T;T
+#Global_Subbands=98..297;200
+
+# startTimeUTC, the start time of the first observation. format: yyyy-MM-dd hh:mm:ss
+# un-comment the startTimeUTC to have the observation start times generated
+startTimeUTC=2017-05-09 03:00:00
+# timeStep's in seconds
+timeStep1=0
+#timeStep2=60
+
+#calibratorBeam=
+#19:59:28.35;+40:44:02.0;3C295;;;;;T;60
+
+TAB:
+c;05:34:51.94;+22:00:52.2               # a coherent tab with absolute coordinates 05:34:51.94, +22:00:52.2
+i;05:34:51.94;+22:00:52.2
+c;05:34:52.02;+22:00:52.5
+i;05:34:52.02;+22:00:52.5
+
+# target beams and target pipelines
+# ra ;dec; targetname; subbandList; nrSubbands; nrTABrings; TABringSize; create_pipeline [;pipeline duration seconds]
+# optionally followed by BBS and/or demixing settings
+targetBeams=
+05:34:51.94;+22:00:52.2;Crab pointing 1;98..297;200;2;0.1;F;600
+05:34:52.02;+22:00:52.5;Crab pointing 2;297..396;100;2;0.1;F;600
+
diff --git a/SAS/XML_generator/test/test_regression.in_data/xml/test_input_commensal_obs_DRAGNET.xml b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_commensal_obs_DRAGNET.xml
new file mode 100644
index 0000000000000000000000000000000000000000..17a14b7fa6a03c6e4bb857564bd3980eedbe7c72
--- /dev/null
+++ b/SAS/XML_generator/test/test_regression.in_data/xml/test_input_commensal_obs_DRAGNET.xml
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+  <lofar:project xmlns:lofar="http://www.astron.nl/MoM2-Lofar" xmlns:mom2="http://www.astron.nl/MoM2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.astron.nl/MoM2-Lofar http://lofar.astron.nl:8080/mom3/schemas/LofarMoM2.xsd http://www.astron.nl/MoM2 http://lofar.astron.nl:8080/mom3/schemas/MoM2.xsd ">
+  <version>2.21.0</version>
+  <template version="2.21.0" author="Alwin de Jong,Adriaan Renting" changedBy="Adriaan Renting">
+  <description>XML Template generator version 2.21.0</description>
+  </template>
+  <name>test_lofar</name>
+  <children>
+   <item index="0">
+    <lofar:folder topology_parent="false">
+    <name>xmlgen_commensal_test</name>
+    <description>Commensal Observation DRAGNET (XMLgenerator test)</description>
+    <children>
+   <item index="0">
+        <lofar:folder topology_parent="true">
+          <topology>0</topology>
+          <name>commensalobs-DRAGNET</name>
+          <description>Commensal Obs package description (none)</description>
+          <children>
+          <item index="0">
+                <lofar:observation>
+                  <name>Crab pointing 1/1/TO</name>
+                  <description>Crab pointing 1/1/TO (Target Observation)</description>
+                  <topology>B0.1.T</topology>
+                  <predecessor_topology></predecessor_topology>
+                  <currentStatus>
+                    <mom2:openedStatus/>
+                  </currentStatus>
+                  <lofar:observationAttributes>
+                    <observationId>
+                    </observationId>
+                    <name>Crab pointing 1/1/TO</name>
+                    <projectName>test_lofar</projectName>
+                    <instrument>Beam Observation</instrument>
+                    <defaultTemplate>BeamObservation</defaultTemplate>
+                    <tbbPiggybackAllowed>true</tbbPiggybackAllowed>
+                    <aartfaacPiggybackAllowed>true</aartfaacPiggybackAllowed>
+                    <userSpecification>
+                      <correlatedData>true</correlatedData>
+                      <coherentStokesData>true</coherentStokesData>
+                      <incoherentStokesData>true</incoherentStokesData>
+                      <antenna>HBA Dual</antenna>
+                      <clock mode="200 MHz"/>
+                      <instrumentFilter>110-190 MHz</instrumentFilter>
+                      <integrationInterval>4.0</integrationInterval>
+                      <channelsPerSubband>16</channelsPerSubband>
+                      <coherentDedisperseChannels>false</coherentDedisperseChannels>
+                      <tiedArrayBeams>
+                        <flyseye>false</flyseye>
+                      </tiedArrayBeams>
+                      <stokes>
+                        <integrateChannels>false</integrateChannels>
+                        <subbandsPerFileCS>20</subbandsPerFileCS>
+                        <numberCollapsedChannelsCS>16</numberCollapsedChannelsCS>
+                        <stokesDownsamplingStepsCS>6</stokesDownsamplingStepsCS>
+                        <whichCS>XXYY</whichCS>
+                        <subbandsPerFileIS>40</subbandsPerFileIS>
+                        <numberCollapsedChannelsIS>1</numberCollapsedChannelsIS>
+                        <stokesDownsamplingStepsIS>12</stokesDownsamplingStepsIS>
+                        <whichIS>I</whichIS>
+                      </stokes>
+                      <stationSet>Custom</stationSet>
+                      <stations>CS001,CS002,CS003,CS004,CS005,CS006,CS007,CS011,CS013,CS017,CS021,CS024,CS026,CS028,CS030,CS031,CS032,CS101,CS103,CS201,CS301,CS302,CS401,CS501</stations>
+                      <timeFrame>UT</timeFrame>
+                      <startTime>2017-05-09T03:00:00</startTime>
+                      <endTime>2017-05-09T03:10:00</endTime>
+                      <duration>600</duration>
+                      <bypassPff>false</bypassPff>
+                      <enableSuperterp>false</enableSuperterp>
+                      <numberOfBitsPerSample>8</numberOfBitsPerSample>
+                    </userSpecification>
+                  </lofar:observationAttributes>
+                  <children>
+<item index="0">
+                      <lofar:measurement xsi:type="lofar:BFMeasurementType">
+                        <name>Crab pointing 1</name>
+                        <description>Crab pointing 1</description>
+                        <topology>B0.1.T.SAP000</topology>
+                        <currentStatus>
+                          <mom2:openedStatus/>
+                        </currentStatus>
+                        <lofar:bfMeasurementAttributes>
+                          <measurementType>Target</measurementType>
+                          <specification>
+                            <targetName>Crab pointing 1</targetName>
+                            <ra>83.7164166667</ra>
+                            <dec>22.0145</dec>
+                            <equinox>J2000</equinox>
+                            <duration>0</duration>
+                            <subbandsSpecification>
+                              <subbands>98..297</subbands>
+                            </subbandsSpecification>
+                          <tiedArrayBeams>
+                            <flyseye>false</flyseye>
+                          <nrTabRings>2</nrTabRings>
+                          <tabRingSize>0.1</tabRingSize>
+                            <tiedArrayBeamList>
+                              
+                            </tiedArrayBeamList>
+                          </tiedArrayBeams>
+                          </specification>
+                        </lofar:bfMeasurementAttributes>
+                        <resultDataProducts>
+                                          <item>
+                    <lofar:uvDataProduct>
+                    <name>B0.1.T.SAP000.uv.dps</name>
+                    <topology>B0.1.T.SAP000.uv.dps</topology>
+                    <status>no_data</status>
+                    <storageCluster>
+                      <name>DRAGNET</name>
+                      <partition></partition>
+                    </storageCluster>
+                    </lofar:uvDataProduct>
+                  </item>
+                                  <item>
+                    <lofar:bfDataProduct>
+                    <name>B0.1.T.SAP000.csis</name>
+                    <topology>B0.1.T.SAP000.csis</topology>
+                    <status>no_data</status>
+                    <storageCluster>
+                      <name>DRAGNET</name>
+                      <partition></partition>
+                    </storageCluster>
+                    </lofar:bfDataProduct>
+                  </item>
+                        </resultDataProducts>   
+                      </lofar:measurement>
+                    </item>
+<item index="0">
+                      <lofar:measurement xsi:type="lofar:BFMeasurementType">
+                        <name>Crab pointing 2</name>
+                        <description>Crab pointing 2</description>
+                        <topology>B0.1.T.SAP001</topology>
+                        <currentStatus>
+                          <mom2:openedStatus/>
+                        </currentStatus>
+                        <lofar:bfMeasurementAttributes>
+                          <measurementType>Target</measurementType>
+                          <specification>
+                            <targetName>Crab pointing 2</targetName>
+                            <ra>83.71675</ra>
+                            <dec>22.0145833333</dec>
+                            <equinox>J2000</equinox>
+                            <duration>0</duration>
+                            <subbandsSpecification>
+                              <subbands>297..396</subbands>
+                            </subbandsSpecification>
+                          <tiedArrayBeams>
+                            <flyseye>false</flyseye>
+                          <nrTabRings>2</nrTabRings>
+                          <tabRingSize>0.1</tabRingSize>
+                            <tiedArrayBeamList>
+                              
+                            </tiedArrayBeamList>
+                          </tiedArrayBeams>
+                          </specification>
+                        </lofar:bfMeasurementAttributes>
+                        <resultDataProducts>
+                                          <item>
+                    <lofar:uvDataProduct>
+                    <name>B0.1.T.SAP001.uv.dps</name>
+                    <topology>B0.1.T.SAP001.uv.dps</topology>
+                    <status>no_data</status>
+                    <storageCluster>
+                      <name>DRAGNET</name>
+                      <partition></partition>
+                    </storageCluster>
+                    </lofar:uvDataProduct>
+                  </item>
+                                  <item>
+                    <lofar:bfDataProduct>
+                    <name>B0.1.T.SAP001.csis</name>
+                    <topology>B0.1.T.SAP001.csis</topology>
+                    <status>no_data</status>
+                    <storageCluster>
+                      <name>DRAGNET</name>
+                      <partition></partition>
+                    </storageCluster>
+                    </lofar:bfDataProduct>
+                  </item>
+                        </resultDataProducts>   
+                      </lofar:measurement>
+                    </item>
+</children>
+                </lofar:observation>
+                </item>
+</children>
+  </lofar:folder>
+  </item>
+</children>
+  </lofar:folder>
+  </item>
+          </children>
+  </lofar:project>