title: Unable to check existing XML nodes in Adobe Flex 3
body: <p>I am getting an XML data from server (please refer to xmlData value).
  I need to:</p>
  
  <ol>
  <li>Create another XML with non-duplicates Folders</li>
  <li>Create another XML with final count on monthly basis.</li>
  </ol>
  
  <p>I am unable to do this with below code and getting duplicate records.</p>
  
  <pre><code>  private var xmlData:XML = new XML("&lt;root&gt;&lt;SUMMARY_RECORD&gt;&lt;FOLDER&gt;Folder1&lt;/FOLDER&gt;&lt;COUNT&gt;100&lt;/COUNT&gt;&lt;MONTH&gt;Feb&lt;/MONTH&gt;&lt;QUARTER&gt;Q1&lt;/QUARTER&gt;&lt;YEAR&gt;2014&lt;/YEAR&gt;&lt;/SUMMARY_RECORD&gt;&lt;SUMMARY_RECORD&gt;&lt;FOLDER&gt;Folder1&lt;/FOLDER&gt;&lt;COUNT&gt;100&lt;/COUNT&gt;&lt;MONTH&gt;Feb&lt;/MONTH&gt;&lt;QUARTER&gt;Q1&lt;/QUARTER&gt;&lt;YEAR&gt;2014&lt;/YEAR&gt;&lt;/SUMMARY_RECORD&gt;&lt;/root&gt;");
  
      var folderDataXML:XML = new XML("&lt;root&gt;&lt;/root&gt;");
      var folderDGDataXML:XML = new XML("&lt;root&gt;&lt;/root&gt;");
  
      private function loaded():void{
          var item:XML;
          folderDGDataXML.appendChild(new XML("&lt;FOLDER_NAME&gt;&lt;Name&gt;ALL&lt;/Name&gt;&lt;/FOLDER_NAME&gt;"));
          for each (item in xmlData.SUMMARY_RECORD){
              if (folderDGDataXML.FOLDER_NAME.(Name==item.FOLDER).toString() == ""){
                  folderDGDataXML.appendChild(new XML("&lt;FOLDER_NAME&gt;&lt;Name&gt;"+item.FOLDER+"&lt;/Name&gt;&lt;/FOLDER_NAME&gt;"));
              }   
  
              if (folderDataXML.SUMMARY_RECORD.(Name==item.MONTH).toXMLString() == ""){
                  folderDataXML.appendChild(new XML("&lt;SUMMARY_RECORD&gt;&lt;Name&gt;"+item.MONTH+"&lt;/Name&gt;&lt;COUNT&gt;"+item.COUNT+"&lt;/COUNT&gt;&lt;/SUMMARY_RECORD&gt;"));
              }else{
                  var count:int = Number(folderDataXML.SUMMARY_RECORD.(Name==item.MONTH).COUNT) + Number(item.COUNT);
                  folderDataXML.SUMMARY_RECORD.(Name==item.MONTH).COUNT = count;
              }
  
          }
      }
  </code></pre>
  
  <p>Final output, <strong>folderDGDataXML</strong>:  </p>
  
  <pre><code>&lt;root&gt;
    &lt;FOLDER_NAME&gt;
      &lt;Name&gt;ALL&lt;/Name&gt;
    &lt;/FOLDER_NAME&gt;
    &lt;FOLDER_NAME&gt;
      &lt;Name&gt;Folder1&lt;/Name&gt;
    &lt;/FOLDER_NAME&gt;
    &lt;FOLDER_NAME&gt;
      &lt;Name&gt;Folder1&lt;/Name&gt;
    &lt;/FOLDER_NAME&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p><strong>folderDataXML</strong>:</p>
  
  <pre><code>&lt;root&gt;
    &lt;SUMMARY_RECORD&gt;
      &lt;Name&gt;Feb&lt;/Name&gt;
      &lt;COUNT&gt;100&lt;/COUNT&gt;
    &lt;/SUMMARY_RECORD&gt;
    &lt;SUMMARY_RECORD&gt;
      &lt;Name&gt;Feb&lt;/Name&gt;
      &lt;COUNT&gt;100&lt;/COUNT&gt;
    &lt;/SUMMARY_RECORD&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>What am I doing wrong?
  After getting correct XML, I need to populate datagrid &amp; column chart.</p>