title: Split XML file into multiple files using XSLT
body: <p>I am having trouble splitting an XML file into multiple files using XSLT.</p>
  
  <p>I've tried splitting the file based on the attached XSLT code.  I've succeeded in getting the file to split.  However, I haven't been able to figure out how to replicate the file and create one for each  in the original file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="2.0"&gt;
  
  &lt;xsl:output method="xml" indent="yes" name="xml"/&gt;
  
  
  &lt;xsl:template match="/"&gt;
  &lt;xsl:for-each select="//FlightGroup"&gt;
  &lt;xsl:variable 
      name="filehandle"
      select="//Info/Campaign/CampaignNumber"/&gt;
  &lt;xsl:variable
      name="FlightGroupId"
      select="FlightGroup-id"
      /&gt;
  &lt;xsl:variable name="filename"
    select="concat('file:///c:/Temp/',$filehandle,'_',$FlightGroupId,'.xml')" /&gt;
  &lt;xsl:value-of select="$filename" /&gt;   &lt;!-- Creating  --&gt;
  &lt;xsl:result-document href="{$filename}" format="xml"&gt;
      &lt;Data&gt;
          &lt;filename&gt;&lt;xsl:value-of select = "concat($filehandle, '_', $FlightGroupId)"/&gt;&lt;/filename&gt;
          &lt;xsl:copy-of select = "//OrderCustomers" /&gt;
          &lt;xsl:copy-of select = "//Campaign"/&gt;
          &lt;xsl:copy-of select = "." /&gt;
      &lt;/Data&gt;
      &lt;/xsl:result-document&gt;
  &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>I need to be able to generate one file for each flight group with the rest of the file being a duplicate of the original.</p>
  
  <p>For example:</p>
  
  <p>Source File:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Data&gt;
    &lt;Info&gt;
      &lt;OrderCustomers&gt;
        &lt;OrderCustomer&gt;
          &lt;IsPrimaryOrderer&gt;true&lt;/IsPrimaryOrderer&gt;
          &lt;IsPrimaryPayor&gt;true&lt;/IsPrimaryPayor&gt;
          &lt;Customer&gt;
            &lt;account-number&gt;20007658&lt;/account-number&gt;
            &lt;accountid&gt;7659&lt;/accountid&gt;
            &lt;Name1&gt;DIGITAL TEST ACCOUNT&lt;/Name1&gt;
            &lt;Phone&gt;0000000000&lt;/Phone&gt;
            &lt;Type-id&gt;2&lt;/Type-id&gt;
            &lt;Type&gt;Commercial&lt;/Type&gt;
            &lt;Company-id&gt;1&lt;/Company-id&gt;
            &lt;Company&gt;Company1&lt;/Company&gt;
            &lt;Address&gt;
              &lt;Addr1&gt;123 Main&lt;/Addr1&gt;
              &lt;City&gt;Anytown&lt;/City&gt;
              &lt;Postal-Code&gt;99999&lt;/Postal-Code&gt;
              &lt;Country-id&gt;1&lt;/Country-id&gt;
              &lt;Country&gt;USA&lt;/Country&gt;
              &lt;State-id&gt;113&lt;/State-id&gt;
              &lt;State&gt;TX&lt;/State&gt;
            &lt;/Address&gt;
            &lt;PrimarySalesRep&gt;Rep1&lt;/PrimarySalesRep&gt;
            &lt;Category&gt;Local&lt;/Category&gt;
            &lt;PaymentMethod-id&gt;4&lt;/PaymentMethod-id&gt;
            &lt;PaymentMethod&gt;Credit Card&lt;/PaymentMethod&gt;
          &lt;/Customer&gt;
        &lt;/OrderCustomer&gt;
      &lt;/OrderCustomers&gt;
      &lt;ad-ordered-by&gt;test&lt;/ad-ordered-by&gt;
      &lt;publication-code&gt;Y&lt;/publication-code&gt;
      &lt;pagination-code&gt;N&lt;/pagination-code&gt;
      &lt;ProductionCode&gt;N&lt;/ProductionCode&gt;
      &lt;ad-sold-by-id&gt;113&lt;/ad-sold-by-id&gt;
      &lt;ad-sold-by&gt;Rep1&lt;/ad-sold-by&gt;
      &lt;ad-sold-by-name&gt;National&lt;/ad-sold-by-name&gt;
      &lt;ad-order-taker-id&gt;15&lt;/ad-order-taker-id&gt;
      &lt;ad-order-taker&gt;jsmith&lt;/ad-order-taker&gt;
      &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
      &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
      &lt;LastEditUser&gt;jsmith&lt;/LastEditUser&gt;
      &lt;order-number&gt;00000994&lt;/order-number&gt;
      &lt;price&gt;10.00&lt;/price&gt;
      &lt;company-id&gt;1&lt;/company-id&gt;
      &lt;company&gt;Company1&lt;/company&gt;
      &lt;CreationDate&gt;070220191350&lt;/CreationDate&gt;
      &lt;Campaign&gt;
        &lt;CampaignId&gt;205&lt;/CampaignId&gt;
        &lt;CampaignNumber&gt;00994-01&lt;/CampaignNumber&gt;
        &lt;Name&gt;DIGITAL TEST ACCOUNT01&lt;/Name&gt;
        &lt;Type-id&gt;1&lt;/Type-id&gt;
        &lt;Type&gt;Banner&lt;/Type&gt;
        &lt;Category-id&gt;1&lt;/Category-id&gt;
        &lt;Category&gt;Standard&lt;/Category&gt;
        &lt;StartDate&gt;07072019&lt;/StartDate&gt;
        &lt;EndDate&gt;07312019&lt;/EndDate&gt;
        &lt;Quantity&gt;1000&lt;/Quantity&gt;
        &lt;Price&gt;10.00&lt;/Price&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;7&lt;/Id&gt;
          &lt;Name&gt;300x250&lt;/Name&gt;
          &lt;Width&gt;300&lt;/Width&gt;
          &lt;Height&gt;250&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;6&lt;/Id&gt;
          &lt;Name&gt;728x90&lt;/Name&gt;
          &lt;Width&gt;728&lt;/Width&gt;
          &lt;Height&gt;90&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;FlightGroup&gt;
          &lt;Name&gt;Group1&lt;/Name&gt;
          &lt;FlightGroup-id&gt;296&lt;/FlightGroup-id&gt;
          &lt;CampaignUnit-id&gt;7&lt;/CampaignUnit-id&gt;
          &lt;CampaignUnit&gt;300x250&lt;/CampaignUnit&gt;
          &lt;Quantity&gt;500&lt;/Quantity&gt;
          &lt;StartDate&gt;07072019&lt;/StartDate&gt;
          &lt;EndDate&gt;07312019&lt;/EndDate&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;666&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;3&lt;/Page-id&gt;
            &lt;Page&gt;ATF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;InvoicedAlreadyFlag&gt;0&lt;/InvoicedAlreadyFlag&gt;
            &lt;PublishedFlag&gt;true&lt;/PublishedFlag&gt;
            &lt;Price&gt;2.50&lt;/Price&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26901" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26902" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26903" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26904" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26905" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;667&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;4&lt;/Page-id&gt;
            &lt;Page&gt;BTF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26926" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26927" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26928" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26929" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26930" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
        &lt;/FlightGroup&gt;
        &lt;FlightGroup&gt;
          &lt;Name&gt;Group2&lt;/Name&gt;
          &lt;FlightGroup-id&gt;297&lt;/FlightGroup-id&gt;
          &lt;CampaignUnit-id&gt;6&lt;/CampaignUnit-id&gt;
          &lt;CampaignUnit&gt;728x90&lt;/CampaignUnit&gt;
          &lt;Quantity&gt;500&lt;/Quantity&gt;
          &lt;StartDate&gt;07072019&lt;/StartDate&gt;
          &lt;EndDate&gt;07312019&lt;/EndDate&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;668&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;3&lt;/Page-id&gt;
            &lt;Page&gt;ATF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26951" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26952" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26953" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26954" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26955" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;669&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;4&lt;/Page-id&gt;
            &lt;Page&gt;BTF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26976" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26977" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26978" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26979" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26980" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
        &lt;/FlightGroup&gt;
        &lt;FrequencyCap /&gt;
        &lt;AdServingId&gt;3&lt;/AdServingId&gt;
        &lt;AdServing&gt;DFP&lt;/AdServing&gt;
        &lt;CampaignViewTypeId&gt;2&lt;/CampaignViewTypeId&gt;
        &lt;CampaignViewType&gt;Impressions&lt;/CampaignViewType&gt;
        &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
        &lt;CreateUser&gt;Rep1&lt;/CreateUser&gt;
        &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
        &lt;LastEditUser&gt;Rep1&lt;/LastEditUser&gt;
      &lt;/Campaign&gt;
      &lt;Company&gt;
        &lt;ID&gt;1&lt;/ID&gt;
        &lt;COMPANYCODE&gt;Company1&lt;/COMPANYCODE&gt;
      &lt;/Company&gt;
    &lt;/Info&gt;
  &lt;/Data&gt;
  </code></pre>
  
  <p>File #1 - 00994-01_296.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Data&gt;
    &lt;Info&gt;
      &lt;OrderCustomers&gt;
        &lt;OrderCustomer&gt;
          &lt;IsPrimaryOrderer&gt;true&lt;/IsPrimaryOrderer&gt;
          &lt;IsPrimaryPayor&gt;true&lt;/IsPrimaryPayor&gt;
          &lt;Customer&gt;
            &lt;account-number&gt;20007658&lt;/account-number&gt;
            &lt;accountid&gt;7659&lt;/accountid&gt;
            &lt;Name1&gt;DIGITAL TEST ACCOUNT&lt;/Name1&gt;
            &lt;Phone&gt;0000000000&lt;/Phone&gt;
            &lt;Type-id&gt;2&lt;/Type-id&gt;
            &lt;Type&gt;Commercial&lt;/Type&gt;
            &lt;Company-id&gt;1&lt;/Company-id&gt;
            &lt;Company&gt;Company1&lt;/Company&gt;
            &lt;Address&gt;
              &lt;Addr1&gt;123 Main&lt;/Addr1&gt;
              &lt;City&gt;Anytown&lt;/City&gt;
              &lt;Postal-Code&gt;99999&lt;/Postal-Code&gt;
              &lt;Country-id&gt;1&lt;/Country-id&gt;
              &lt;Country&gt;USA&lt;/Country&gt;
              &lt;State-id&gt;113&lt;/State-id&gt;
              &lt;State&gt;TX&lt;/State&gt;
            &lt;/Address&gt;
            &lt;PrimarySalesRep&gt;Rep1&lt;/PrimarySalesRep&gt;
            &lt;Category&gt;Local&lt;/Category&gt;
            &lt;PaymentMethod-id&gt;4&lt;/PaymentMethod-id&gt;
            &lt;PaymentMethod&gt;Credit Card&lt;/PaymentMethod&gt;
          &lt;/Customer&gt;
        &lt;/OrderCustomer&gt;
      &lt;/OrderCustomers&gt;
      &lt;ad-ordered-by&gt;test&lt;/ad-ordered-by&gt;
      &lt;publication-code&gt;Y&lt;/publication-code&gt;
      &lt;pagination-code&gt;N&lt;/pagination-code&gt;
      &lt;ProductionCode&gt;N&lt;/ProductionCode&gt;
      &lt;ad-sold-by-id&gt;113&lt;/ad-sold-by-id&gt;
      &lt;ad-sold-by&gt;Rep1&lt;/ad-sold-by&gt;
      &lt;ad-sold-by-name&gt;National&lt;/ad-sold-by-name&gt;
      &lt;ad-order-taker-id&gt;15&lt;/ad-order-taker-id&gt;
      &lt;ad-order-taker&gt;jsmith&lt;/ad-order-taker&gt;
      &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
      &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
      &lt;LastEditUser&gt;jsmith&lt;/LastEditUser&gt;
      &lt;order-number&gt;00000994&lt;/order-number&gt;
      &lt;price&gt;10.00&lt;/price&gt;
      &lt;company-id&gt;1&lt;/company-id&gt;
      &lt;company&gt;Company1&lt;/company&gt;
      &lt;CreationDate&gt;070220191350&lt;/CreationDate&gt;
      &lt;Campaign&gt;
        &lt;CampaignId&gt;205&lt;/CampaignId&gt;
        &lt;CampaignNumber&gt;00994-01&lt;/CampaignNumber&gt;
        &lt;Name&gt;DIGITAL TEST ACCOUNT01&lt;/Name&gt;
        &lt;Type-id&gt;1&lt;/Type-id&gt;
        &lt;Type&gt;Banner&lt;/Type&gt;
        &lt;Category-id&gt;1&lt;/Category-id&gt;
        &lt;Category&gt;Standard&lt;/Category&gt;
        &lt;StartDate&gt;07072019&lt;/StartDate&gt;
        &lt;EndDate&gt;07312019&lt;/EndDate&gt;
        &lt;Quantity&gt;1000&lt;/Quantity&gt;
        &lt;Price&gt;10.00&lt;/Price&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;7&lt;/Id&gt;
          &lt;Name&gt;300x250&lt;/Name&gt;
          &lt;Width&gt;300&lt;/Width&gt;
          &lt;Height&gt;250&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;6&lt;/Id&gt;
          &lt;Name&gt;728x90&lt;/Name&gt;
          &lt;Width&gt;728&lt;/Width&gt;
          &lt;Height&gt;90&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;FlightGroup&gt;
          &lt;Name&gt;Group1&lt;/Name&gt;
          &lt;FlightGroup-id&gt;296&lt;/FlightGroup-id&gt;
          &lt;CampaignUnit-id&gt;7&lt;/CampaignUnit-id&gt;
          &lt;CampaignUnit&gt;300x250&lt;/CampaignUnit&gt;
          &lt;Quantity&gt;500&lt;/Quantity&gt;
          &lt;StartDate&gt;07072019&lt;/StartDate&gt;
          &lt;EndDate&gt;07312019&lt;/EndDate&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;666&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;3&lt;/Page-id&gt;
            &lt;Page&gt;ATF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;InvoicedAlreadyFlag&gt;0&lt;/InvoicedAlreadyFlag&gt;
            &lt;PublishedFlag&gt;true&lt;/PublishedFlag&gt;
            &lt;Price&gt;2.50&lt;/Price&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26901" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26902" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26903" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26904" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26905" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;667&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;4&lt;/Page-id&gt;
            &lt;Page&gt;BTF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26926" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26927" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26928" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26929" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26930" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
        &lt;/FlightGroup&gt;
        &lt;FrequencyCap /&gt;
        &lt;AdServingId&gt;3&lt;/AdServingId&gt;
        &lt;AdServing&gt;DFP&lt;/AdServing&gt;
        &lt;CampaignViewTypeId&gt;2&lt;/CampaignViewTypeId&gt;
        &lt;CampaignViewType&gt;Impressions&lt;/CampaignViewType&gt;
        &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
        &lt;CreateUser&gt;Rep1&lt;/CreateUser&gt;
        &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
        &lt;LastEditUser&gt;Rep1&lt;/LastEditUser&gt;
      &lt;/Campaign&gt;
      &lt;Company&gt;
        &lt;ID&gt;1&lt;/ID&gt;
        &lt;COMPANYCODE&gt;Company1&lt;/COMPANYCODE&gt;
      &lt;/Company&gt;
    &lt;/Info&gt;
  &lt;/Data&gt;
  </code></pre>
  
  <p>File #2 - 00994-01_297.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Data&gt;
    &lt;Info&gt;
      &lt;OrderCustomers&gt;
        &lt;OrderCustomer&gt;
          &lt;IsPrimaryOrderer&gt;true&lt;/IsPrimaryOrderer&gt;
          &lt;IsPrimaryPayor&gt;true&lt;/IsPrimaryPayor&gt;
          &lt;Customer&gt;
            &lt;account-number&gt;20007658&lt;/account-number&gt;
            &lt;accountid&gt;7659&lt;/accountid&gt;
            &lt;Name1&gt;DIGITAL TEST ACCOUNT&lt;/Name1&gt;
            &lt;Phone&gt;0000000000&lt;/Phone&gt;
            &lt;Type-id&gt;2&lt;/Type-id&gt;
            &lt;Type&gt;Commercial&lt;/Type&gt;
            &lt;Company-id&gt;1&lt;/Company-id&gt;
            &lt;Company&gt;Company1&lt;/Company&gt;
            &lt;Address&gt;
              &lt;Addr1&gt;123 Main&lt;/Addr1&gt;
              &lt;City&gt;Anytown&lt;/City&gt;
              &lt;Postal-Code&gt;99999&lt;/Postal-Code&gt;
              &lt;Country-id&gt;1&lt;/Country-id&gt;
              &lt;Country&gt;USA&lt;/Country&gt;
              &lt;State-id&gt;113&lt;/State-id&gt;
              &lt;State&gt;TX&lt;/State&gt;
            &lt;/Address&gt;
            &lt;PrimarySalesRep&gt;Rep1&lt;/PrimarySalesRep&gt;
            &lt;Category&gt;Local&lt;/Category&gt;
            &lt;PaymentMethod-id&gt;4&lt;/PaymentMethod-id&gt;
            &lt;PaymentMethod&gt;Credit Card&lt;/PaymentMethod&gt;
          &lt;/Customer&gt;
        &lt;/OrderCustomer&gt;
      &lt;/OrderCustomers&gt;
      &lt;ad-ordered-by&gt;test&lt;/ad-ordered-by&gt;
      &lt;publication-code&gt;Y&lt;/publication-code&gt;
      &lt;pagination-code&gt;N&lt;/pagination-code&gt;
      &lt;ProductionCode&gt;N&lt;/ProductionCode&gt;
      &lt;ad-sold-by-id&gt;113&lt;/ad-sold-by-id&gt;
      &lt;ad-sold-by&gt;Rep1&lt;/ad-sold-by&gt;
      &lt;ad-sold-by-name&gt;National&lt;/ad-sold-by-name&gt;
      &lt;ad-order-taker-id&gt;15&lt;/ad-order-taker-id&gt;
      &lt;ad-order-taker&gt;jsmith&lt;/ad-order-taker&gt;
      &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
      &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
      &lt;LastEditUser&gt;jsmith&lt;/LastEditUser&gt;
      &lt;order-number&gt;00000994&lt;/order-number&gt;
      &lt;price&gt;10.00&lt;/price&gt;
      &lt;company-id&gt;1&lt;/company-id&gt;
      &lt;company&gt;Company1&lt;/company&gt;
      &lt;CreationDate&gt;070220191350&lt;/CreationDate&gt;
      &lt;Campaign&gt;
        &lt;CampaignId&gt;205&lt;/CampaignId&gt;
        &lt;CampaignNumber&gt;00994-01&lt;/CampaignNumber&gt;
        &lt;Name&gt;DIGITAL TEST ACCOUNT01&lt;/Name&gt;
        &lt;Type-id&gt;1&lt;/Type-id&gt;
        &lt;Type&gt;Banner&lt;/Type&gt;
        &lt;Category-id&gt;1&lt;/Category-id&gt;
        &lt;Category&gt;Standard&lt;/Category&gt;
        &lt;StartDate&gt;07072019&lt;/StartDate&gt;
        &lt;EndDate&gt;07312019&lt;/EndDate&gt;
        &lt;Quantity&gt;1000&lt;/Quantity&gt;
        &lt;Price&gt;10.00&lt;/Price&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;7&lt;/Id&gt;
          &lt;Name&gt;300x250&lt;/Name&gt;
          &lt;Width&gt;300&lt;/Width&gt;
          &lt;Height&gt;250&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;CampaignUnit&gt;
          &lt;Id&gt;6&lt;/Id&gt;
          &lt;Name&gt;728x90&lt;/Name&gt;
          &lt;Width&gt;728&lt;/Width&gt;
          &lt;Height&gt;90&lt;/Height&gt;
        &lt;/CampaignUnit&gt;
        &lt;FlightGroup&gt;
          &lt;Name&gt;Group2&lt;/Name&gt;
          &lt;FlightGroup-id&gt;297&lt;/FlightGroup-id&gt;
          &lt;CampaignUnit-id&gt;6&lt;/CampaignUnit-id&gt;
          &lt;CampaignUnit&gt;728x90&lt;/CampaignUnit&gt;
          &lt;Quantity&gt;500&lt;/Quantity&gt;
          &lt;StartDate&gt;07072019&lt;/StartDate&gt;
          &lt;EndDate&gt;07312019&lt;/EndDate&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;668&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;3&lt;/Page-id&gt;
            &lt;Page&gt;ATF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26951" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26952" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26953" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26954" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26955" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
          &lt;Flight&gt;
            &lt;Flight-id&gt;669&lt;/Flight-id&gt;
            &lt;Site-id&gt;2&lt;/Site-id&gt;
            &lt;NetworkId&gt;3&lt;/NetworkId&gt;
            &lt;Network&gt;Digital&lt;/Network&gt;
            &lt;Site&gt;anysite.com&lt;/Site&gt;
            &lt;Section-id&gt;20&lt;/Section-id&gt;
            &lt;Section&gt;Business&lt;/Section&gt;
            &lt;Page-id&gt;4&lt;/Page-id&gt;
            &lt;Page&gt;BTF&lt;/Page&gt;
            &lt;SiteURL&gt;www.anysite.com&lt;/SiteURL&gt;
            &lt;Quantity&gt;250&lt;/Quantity&gt;
            &lt;dates&gt;
              &lt;date Insertion-id="26976" PublishedFlag="true"&gt;07072019&lt;/date&gt;
              &lt;date Insertion-id="26977" PublishedFlag="true"&gt;07082019&lt;/date&gt;
              &lt;date Insertion-id="26978" PublishedFlag="true"&gt;07092019&lt;/date&gt;
              &lt;date Insertion-id="26979" PublishedFlag="true"&gt;07102019&lt;/date&gt;
              &lt;date Insertion-id="26980" PublishedFlag="true"&gt;07112019&lt;/date&gt;
            &lt;/dates&gt;
          &lt;/Flight&gt;
        &lt;/FlightGroup&gt;
        &lt;FrequencyCap /&gt;
        &lt;AdServingId&gt;3&lt;/AdServingId&gt;
        &lt;AdServing&gt;DFP&lt;/AdServing&gt;
        &lt;CampaignViewTypeId&gt;2&lt;/CampaignViewTypeId&gt;
        &lt;CampaignViewType&gt;Impressions&lt;/CampaignViewType&gt;
        &lt;CreateDate&gt;07022019 13:50:31&lt;/CreateDate&gt;
        &lt;CreateUser&gt;Rep1&lt;/CreateUser&gt;
        &lt;LastEditDate&gt;07022019 13:50:33&lt;/LastEditDate&gt;
        &lt;LastEditUser&gt;Rep1&lt;/LastEditUser&gt;
      &lt;/Campaign&gt;
      &lt;Company&gt;
        &lt;ID&gt;1&lt;/ID&gt;
        &lt;COMPANYCODE&gt;Company1&lt;/COMPANYCODE&gt;
      &lt;/Company&gt;
    &lt;/Info&gt;
  &lt;/Data&gt;
  </code></pre>