title: rapidXML parsing misbehavior
body: <p>I'm trying to parse a xml file:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;settings&gt;
      &lt;output&gt;test.dat&lt;/output&gt;
      &lt;width&gt;5&lt;/width&gt;
      &lt;depth&gt;4&lt;/depth&gt;
      &lt;height&gt;10&lt;/height&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>main:</p>
  
  <pre><code>int _tmain(int argc, wchar_t* argv[])
  {
      std::string SettingsFile = "settings.xml";
      rapidxml::xml_document&lt;&gt; doc;
      char* settings = FileHandler::readFileInChar(SettingsFile.c_str());
  
      std::cout &lt;&lt; strlen(settings); // Output 1
      doc.parse&lt;0 | rapidxml::parse_no_data_nodes&gt;(settings);
      std::cout &lt;&lt; strlen(settings); // Output 2
  
      ....
  }
  </code></pre>
  
  <p>Output1: 129</p>
  
  <p>Output2: 31</p>
  
  <p>helper functions:</p>
  
  <pre><code>static char* readFileInChar(const char* p_pccFile) 
  {
      char* cpBuffer;
      size_t sSize;
  
      std::ifstream ifFileToRead;
      ifFileToRead.open(p_pccFile, std::ios::binary);
  
      if(ifFileToRead.is_open()) {
          sSize = getFileLength(&amp;ifFileToRead);
  
          cpBuffer = new char[sSize+1];
          ifFileToRead.read(cpBuffer, sSize);
          ifFileToRead.close();
      }
  
      cpBuffer[sSize] = '\0';
  
      return cpBuffer;
  }
  
  static size_t getFileLength(std::ifstream* file) 
  {
      file-&gt;seekg(0, std::ios::end);
      size_t length = file-&gt;tellg();
      file-&gt;seekg(0, std::ios::beg);
  
      return length;
  }
  </code></pre>
  
  <p>This results in exceptions when I try to access any nodes. I guess I'm missing something obvious here but so far I don't get it. </p>
  
  <p>If I try something like:</p>
  
  <pre><code>std::cout &lt;&lt; doc.first_node("output")-&gt;value();
  </code></pre>
  
  <p>I get the message that there has been an access violation while reading position 0x00000004.</p>