title: How to extract a part of xml code from an xml file using c# code
body: <pre><code> &lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt; 
   &lt;eRecon xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:noNamespaceSchemaLocation="eRecon.xsd"&gt;
   &lt;Header&gt;
    &lt;Company Code="" /&gt; 
    &lt;CommonCarrierCode /&gt; 
    &lt;InputFileName InputIDPk=""&gt;F:\ReconNew\TmesysRec20100111.rec&lt;/InputFileName&gt; 
    &lt;BatchNumber&gt;000152&lt;/BatchNumber&gt; 
    &lt;InputStartDateTime&gt;2010-02-26 11:47:00&lt;/InputStartDateTime&gt; 
    &lt;InputFinishDateTime&gt;2010-02-26 11:47:05&lt;/InputFinishDateTime&gt; 
    &lt;RecordCount&gt;8&lt;/RecordCount&gt; 
    &lt;/Header&gt;
   &lt;Detail&gt;
    &lt;CarrierStatusDate&gt;2010-01-11&lt;/CarrierStatusDate&gt; 
    &lt;ClaimNum&gt;YDF02892 C&lt;/ClaimNum&gt; 
    &lt;InvoiceNum&gt;0108013775&lt;/InvoiceNum&gt; 
    &lt;LineItemNum&gt;001&lt;/LineItemNum&gt; 
    &lt;NABP&gt;10600211&lt;/NABP&gt; 
    &lt;RxNumber&gt;4695045&lt;/RxNumber&gt; 
    &lt;RxDate&gt;2008-07-21&lt;/RxDate&gt; 
    &lt;CheckNum /&gt; 
    &lt;PaymentStatus&gt;PENDING&lt;/PaymentStatus&gt; 
    &lt;RejectDescription /&gt; 
    &lt;InvoiceChargeAmount&gt;152.15&lt;/InvoiceChargeAmount&gt; 
    &lt;InvoicePaidAmount&gt;131.00&lt;/InvoicePaidAmount&gt; 
   &lt;/Detail&gt;
   &lt;/eRecon&gt;
  </code></pre>
  
  <p>How can I  extract the portion</p>
  
  <pre><code> &lt;Header&gt;
    &lt;Company Code="" /&gt; 
    &lt;CommonCarrierCode /&gt; 
    &lt;InputFileName InputIDPk=""&gt;F:\ReconNew\TmesysRec20100111.rec&lt;/InputFileName&gt; 
    &lt;BatchNumber&gt;000152&lt;/BatchNumber&gt; 
    &lt;InputStartDateTime&gt;2010-02-26 11:47:00&lt;/InputStartDateTime&gt; 
    &lt;InputFinishDateTime&gt;2010-02-26 11:47:05&lt;/InputFinishDateTime&gt; 
    &lt;RecordCount&gt;8&lt;/RecordCount&gt; 
   &lt;/Header&gt;
  </code></pre>
  
  <p>from the above xml file.</p>
  
  <p>I need the c# code to extract a part of xml tag from an xml file.</p>