title: Writing xml with powershell
body: <p>i have a script that get all the info i need about my SharePoint farm :</p>
  
  <pre><code>[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") &gt; $null
  
  $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local 
  $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]} 
  $webapps = @()
  
  foreach ($websvc in $websvcs) { 
             write-output "Web Applications" 
             write-output "" 
      foreach ($webapp in $websvc.WebApplications) { 
          write-output "Webapp Name --&gt;"$webapp.Name 
             write-output "" 
             write-output "Site Collections" 
             write-output "" 
      foreach ($site in $webapp.Sites) { 
          write-output "Site URL --&gt; --&gt;" $site.URL 
             write-output "" 
             write-output "Websites" 
             write-output "" 
      foreach ($web in $site.AllWebs) { 
          write-output "Web URL --&gt; --&gt; --&gt;" $web.URL 
             write-output "" 
             write-output "Lists" 
             write-output "" 
      foreach ($list in $web.Lists) { 
             write-output "List Title --&gt; --&gt; --&gt; --&gt;" $list.Title 
             write-output "" 
      }
  
      foreach ($group in $web.Groups) { 
             write-output "Group Name --&gt; --&gt; --&gt; --&gt;" $group.Name 
             write-output ""
  
      foreach ($user in $group.Users) { 
             write-output "User Name --&gt; --&gt; --&gt; --&gt;" $user.Name 
             write-output "" 
      } 
      }
  
      }
  
      }
  
      } 
  }
  </code></pre>
  
  <p>i want to make the output to an XML file and then connect the xml file to HTML and make a site of it for manager use </p>
  
  <p>how can i do it ?</p>
  
  <p>thanks for the help !</p>