title: How to append xml from hash table values in powershell
body: <p>I am having a hash table where it has Component names as Key and Baseline as Values.</p>
  
  <p>Following lines depict my hash table</p>
  
  <pre><code>Name                           Value                                                                                                                           
  ----                           -----                                                                                                                                       
  Comp_Bin                       Comp_12_23_2011.1276                                                                            
  Complicen                      Comp_11_2_2011.461                                               
  SupportComp                    Comp_2.1.0.17.1135                                                                                                  
  </code></pre>
  
  <p>I would like to add this values to xml file available already</p>
  
  <pre><code>&lt;Component&gt;
      &lt;Name&gt;&lt;/Name&gt;
      &lt;Baseline&gt;&lt;/Baseline&gt;
      &lt;KLOC&gt;0&lt;/KLOC&gt;
      &lt;IsCount&gt;True&lt;/IsCount&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>Adding hash value to xml and make it as follows</p>
  
  <pre><code>&lt;Components&gt;
     &lt;Name&gt;Comp_Bin&lt;/Name&gt;
     &lt;Baseline&gt;Comp_12_23_2011.1276&lt;/Baseline&gt;
     &lt;KLOC&gt;0&lt;/KLOC&gt;
     &lt;IsCount&gt;True&lt;/IsCount&gt;
  &lt;/Component&gt;
  </code></pre>
  
  <p>How to convert hash table to xml? please help me.</p>
  
  <p>I have parsed my hash table like below but the following code fails as XML contents has to be copied every time then change the Name and Baseline element alone</p>
  
  <pre><code>$CCountDoc= [XML] (Get-Content "ccount.xml")
      foreach($key in $($hash.keys)){
  
       $Baseline = $hash[$key]
       $Name= $key 
  
       $CCountDoc.Name=$Name
       $CCountDoc.Baseline=$Baseline
      }
  </code></pre>