title: Extracting timestamps from an XML file
body: <p>I am supposed to extract timestamps from the following XML document and output the timestamps to an output file. However, what I've created so far extracts the timestamps in addition to the code before them, when I just want the timestamps(eg:timestamp="2014-07-08T18:14:16.468Z" ) . Could someone please point out what I'm doing wrong? Thanks in advance!</p>
  
  <p>XML document: <a href="http://pastebin.com/DLVF0cXY" rel="nofollow">http://pastebin.com/DLVF0cXY</a></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main()
  {
  string tempStr;
  
  ifstream inFile;
  ofstream outFile;
  outFile.open("Outputdata.txt");
  inFile.open("Groupproject.xml");
  if (inFile.fail()) {
      cout &lt;&lt; "Error Opening File" &lt;&lt; endl;
      system("pause");
      exit(1);
  }
  while (inFile) {
      inFile &gt;&gt; tempStr;
      if (tempStr.find('Z\"') != string::npos) {
          cout &lt;&lt; "Found timestamp" &lt;&lt; tempStr;
          outFile &lt;&lt; tempStr &lt;&lt; endl;
          cout &lt;&lt; "Copied to file" &lt;&lt; endl;
      }
  }
  inFile.close();
  outFile.close();
  system("pause");
  return 0;
  }
  </code></pre>