title: TestNG DataProvider reading test data from the testng.xml config file?
body: <p>Is it possible for a TestNG DataProvider to read test data from the testng.xml config file?  Or is this unrealistic for some reason?   I would like to be able to read test data from that file at the suite level and class level.</p>
  
  <p>So, given a testing.xml file like this (which I am unsure is realistic or not), how would I do this?  I have written a DataProvider using XStream (or Jackson) before and so I am well versed in my own custom .xml format, but sticking to the strict format of the testing.xml is where I am worried about this.</p>
  
  <p><strong>The following testing.xml is obvious invalid but I am just trying to show the kind of thing I would like to do:</strong></p>
  
  <pre><code>&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt; 
  &lt;suite name="TestAll"&gt; 
    &lt;parameter name="hubUrl" value="http://localhost:4444/wd/hub"/&gt;
    &lt;parameter name="reportFile" value="CustomReport.html"/&gt;
    &lt;test name="etsy"&gt;
      &lt;parameter name="reportFile" value="CustomReport.html"/&gt;
      &lt;classes&gt;
        &lt;class name="qa.examples.suite.TestSearch"&gt;
          &lt;parameter name="appUrl"  value="http://etsy.com" type="java.lang.String"/&gt; 
          &lt;parameter name="browser"  value="Firefox" type="java.lang.String"/&gt;    
          &lt;parameter name="testEnabled" value="true" type="java.lang.Boolean"/&gt; 
          &lt;methods&gt;                 
            &lt;include name="testEtsySearch"/&gt;
              &lt;tests&gt;
                &lt;test&gt;
                  &lt;parameter name="testNum" value="1" type="java.lang.Integer"/&gt;
                  &lt;parameter name="searchTerm" value="cell phone" type="java.lang.String"/&gt;
                  &lt;parameter name="searchTerm" value="batteries" type="java.lang.String"/&gt;
                &lt;/test&gt;
                &lt;test&gt;
                  &lt;parameter name="testNum" value="2" type="java.lang.Integer"/&gt;
                  &lt;parameter name="searchTerm" value="buttons" type="java.lang.String"/&gt;
                  &lt;parameter name="searchTerm" value="metal" type="java.lang.String"/&gt;
                &lt;/test&gt;
              &lt;/tests&gt;
            &lt;/include&gt;                       
          &lt;/methods&gt; 
        &lt;/class&gt;
        &lt;class name="qa.examples.suite.TestFilters" /&gt;
      &lt;/classes&gt;
      &lt;/test&gt; 
  &lt;/suite&gt;
  </code></pre>
  
  <p>So, is something like this possible?  If so, how would you do it?</p>