title: Read escaped quote as escaped quote from xml
body: <p>I load xml file into DOM model and analyze it.</p>
  
  <p>The code for that is:</p>
  
  <pre><code>public class MyTest {
  public static void main(String[] args) {        
      Document doc = XMLUtils.fileToDom("MyTest.xml");//Loads xml data to DOM
      Element rootElement = doc.getDocumentElement();
      NodeList nodes = rootElement.getChildNodes();
      Node child1 = nodes.item(1);
      Node child2 = nodes.item(3);
      String str1 = child1.getTextContent();
      String str2 = child2.getTextContent();      
      if(str1 != null){
          System.out.println(str1.equals(str2));
      }
      System.out.println();
      System.out.println(str1);
      System.out.println(str2);
  }   
  </code></pre>
  
  <p>}</p>
  
  <p>MyTest.xml</p>
  
  <pre><code>&lt;tests&gt;
     &lt;test name="1"&gt;ff1 &amp;quot;&lt;/test&gt;
     &lt;test name="2"&gt;ff1 "&lt;/test&gt;
  &lt;/tests&gt;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>true
  
  ff1 "
  ff1 "
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>false
  
  ff1 &amp;quot;
  ff1 "
  </code></pre>
  
  <p>So I need to distinguish these two cases: when the quote is escaped and is not.</p>
  
  <p>Please help.</p>
  
  <p>Thank you in advance.</p>
  
  <p>P.S. The code for XMLUtils#fileToDom(String filePath), a snippet from XMLUtils class:</p>
  
  <pre><code>static {
      DocumentBuilderFactory dFactory = DocumentBuilderFactory.newInstance();
      dFactory.setNamespaceAware(false);
      dFactory.setValidating(false);
      try {
          docNonValidatingBuilder = dFactory.newDocumentBuilder();
      } catch (ParserConfigurationException e) {
      }
  }
  
  public static DocumentBuilder getNonValidatingBuilder() {
      return docNonValidatingBuilder;
  }
  
  public static Document fileToDom(String filePath) {
  
      Document doc = getNonValidatingBuilder().newDocument();
      File f = new File(filePath);
      if(!f.exists())
          return doc;
  
      try {
          Transformer transformer = TransformerFactory.newInstance().newTransformer();
          DOMResult result = new DOMResult(doc);
          StreamSource source = new StreamSource(f);
          transformer.transform(source, result);
      } catch (Exception e) {
          return doc;
      }
  
      return doc;
  
  }
  </code></pre>