title: C++ Parse XML Using STD
body: <p>I'm aware there are several XML libaries out there, but unfortunately, I am unable to use them for a school project I am working on.</p>
  
  <p>I have a program that created this XML file.</p>
  
  <pre><code>&lt;theKey&gt;
  &lt;theValue&gt;23432&lt;/theValue&gt;
  &lt;/theKey&gt;
  </code></pre>
  
  <p>What I am trying to do is parse out "23432" between the  tags.  However, there are random tags in the file so  may not always on the second line from the top.  Also, I don't know how many digits the number is between the  tags.</p>
  
  <p>Here is the code I developed so far.  It is basic because I don't know what I can use that is part of the C++ language that will parse the value out.  My hint, from me working with JAVA, is to use somethign from the "String" library but so far I am coming up short on what I can use.  </p>
  
  <p>Can anyone give me direction or a clue on what I can do/use?  Thanks a lot.</p>
  
  <p>Here is the code I developed so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  
  using std::cout;
  using std::cin;
  using std::endl;
  using std::fstream;
  using std::string;
  using std::ifstream;
  
  
  int main()
  {
   ifstream inFile;
   inFile.open("theXML.xml");
  
   if (!inFile)
   {
   }
  
   string x;
   while (inFile &gt;&gt; x)
   {
    cout &lt;&lt; x &lt;&lt; endl;
   }
  
   inFile.close();
  
   system ( "PAUSE" );
  
  
   return 0;
  }
  </code></pre>