title: Parsing XML with apostrophe
body: <p>Taking the BBC News RSS feed for example, one of their news items is as follows:</p>
  
  <pre><code>&lt;item&gt;&lt;title&gt;Pupils 'bullied on sports field'&lt;/title&gt;&lt;description&gt;bla bla..
  </code></pre>
  
  <p>I have some java code parsing this - however, when a title contains an apostrophe (as above), the parsing stops, so I end up with the following title: <strong>Pupils '</strong> and then it continues on and parses the description (which is fine). How do I get it to parse the full title? The following is a segment of code from inside my for loop where I parse the info:</p>
  
  <pre><code>                    NodeList title = element.getElementsByTagName("title");
                      Element line = (Element) title.item(0);
                      tmp.setTitle(getCharacterDataFromElement(line).toString());
  </code></pre>
  
  <p>The exact same code is used to parse the other elements like description and pubDate etc, which are all fine.</p>
  
  <p>This is the getCharacterDataFromElement method:</p>
  
  <pre><code>public static String getCharacterDataFromElement(Element e) {
      Node child = ((Node) e).getFirstChild();
      if (child instanceof CharacterData) {
          CharacterData cd = (CharacterData) child;
          return cd.getData();
      }
      return "";
  }
  </code></pre>
  
  <p>What am I doing wrong? I use the DocumentBuilder, DocumentBuilderFactory and org.w3c.dom to work with the RSS Feed.</p>