Packagepart copy to file or to memory
<p>I want to extract a xlsx file to get the sheet1.xml file. Now I am struggling with the package and PackagePart. I think the most obvious way is to read that particular file and copy the content to the <code>XmlDocument</code>
This is what i have this far:</p>

<pre><code>XmlDocument doc = new XmlDocument();
using (Package package = ZipPackage.Open(xlsFile, FileMode.Open, FileAccess.Read))
{
     foreach (PackagePart part in package.GetParts())
     {
         var target = Path.GetFullPath(Path.Combine(tempFolderPath, part.Uri.OriginalString.TrimStart('/')));
         var targetDir = target.Remove(target.LastIndexOf('\\'));
         if (!Directory.Exists(targetDir))
             Directory.CreateDirectory(targetDir);

         using (Stream source = part.GetStream(FileMode.Open, FileAccess.Read))
         {
             FileStream targetFile = File.OpenWrite(target);
             byte[] bytes = new byte[source.Length];
             source.Read(bytes, 0, (int)source.Length);
             source.Close();
             //source.CopyTo(targetFile);
             //doc.Load(source.Write());
             //targetFile.Close();
         }
    }
}
</code></pre>

<p>I am using .net 3,5 so I cannot use the Stream <code>source.CopyTo</code> methods.
I would like to copy the contents of the Sheet1.xml to the doc of the XmlDocument class..</p>

<p>Thanks!
Paul</p>
