title: Error: "'<' is an unexpected token. The expected token is ';'
body: <p>I'm trying to append XML into a node </p>
  
  <pre><code>            #Insert Data into template
              foreach ($listXml in $webConfig.Lists.List)
              {
                  $dataXml =""
  
                  if ($listXml.IncludeData)
                  {
                      $list = Get-PnPList -Web $web -Identity $listXml.Name       
                      $list.ParentWeb.Context.Load($list.Fields)
                      $list.ParentWeb.Context.ExecuteQuery()
  
                      Write-Host $list.Title
                      $listItems = Get-PnPListItem -List $list.Title
  
                      $dataXml += '&lt;pnp:DataRows xmlns:pnp="http://schemas.dev.office.com/PnP/2016/05/ProvisioningSchema"&gt;'
  
  
                      foreach ($listItem in $listItems)
                      {
  
                         $dataXml += "&lt;pnp:DataRow&gt;"
  
  
                         foreach($fieldValue in $listItem.FieldValues.GetEnumerator())
                         {
  
                              $fieldName = $fieldValue.Key #($list.Fields | Where {$_.InternalName -eq $fieldValue.Key}).Title
  
                              if ($fieldName -notin "ServerRedirectedEmbedUri", "ContentTypeID", "_ModerationComments", "File_x0020_Type", "ID","Author","Created","Editor","Modified By","_HasCopyDestinations",
              "_CopySource", "owshiddenversion", "WorkflowVersion", "_UIVersion", "_UIVersionString", "Attachments", "FileRef", "FileDirRef", "_ModerationStatus", "InstanceID", "WorkflowInstanceID", "Order", "GUID", "Workflow Instance ID", "URL Path",
              "Path", "Modified", "Created", "Item Type", "Sort Type", "Name",  "Unique Id",  "Client Id",  "ProgId", "ScopeId", "Property Bag", "_Level", "_IsCurrentVersion","ItemChildCount",
              "FolderChildCount","Restricted", "OriginatorId", 'ContentVersion;', "_ComplianceFlags", "_ComplianceTag", "_ComplianceTagWrittenTime", "_ComplianceTagUserId",
              "AccessPolicy", "AppAuthor","AppEditor", "SMTotalSize", "SMLastModifiedDate", "SMTotalFileStreamSize", "SMTotalFileCount", "Last_x0020_Modified", "Created_x0020_Date", "FSObjType", "SortBehavior",  "FileLeafRef", "UniqueId", "SyncClientId", "MetaInfo",  "NoExecute","ContentVersion" )
                              {
  
                                  if ($fieldName -ne "" -and $fieldName -ne $null)
                                  {                                        
  
                                      $dataXml += "&lt;pnp:DataValue FieldName=""$fieldName"" &gt;" 
                                      $dataXml += $fieldValue.Value
                                      $dataXml += "&lt;/pnp:DataValue&gt;"
  
                                  }
                              }
  
                         }
  
                         $dataXml += "&lt;/pnp:DataRow&gt;"
  
                      }
  
                      $dataXml += "&lt;/pnp:DataRows&gt;"
  
                  }
  
                  $filename = $FILENAME
                  [xml]$templateXml = Get-Content "$path\Templates\$template\$environmentName\$filename"
                  Write-Host $list.Title -ForegroundColor yellow
                  $xmlList = $templateXml.Provisioning.Templates.ProvisioningTemplate.Lists.ListInstance | where { $_.Title -eq $list.Title}
  
                  clear-content "templates/log.txt"
                  add-content "templates/log.txt" $dataXml
                  [xml]$XmlData = $dataXml
  
                  $xmlList.AppendChild([System.Xml.XmlNode]$templateXml.ImportNode($XmlData.DataRows,$true))
  
                  $templateXml.Save("$path\Templates\$template\$environmentName\$filename")
  </code></pre>
  
  <p>I'm getting this error and I'm not sure how to troubleshoot Powershell:
  <a href="https://i.stack.imgur.com/qKWbD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qKWbD.png" alt="enter image description here"></a></p>