title: XMLSerializer cannot be resolved to a type
body: <p>I am using the following code : </p>
  
  <pre><code>         PrintStream out = new PrintStream(response.getOutputStream());  
           DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
           DocumentBuilder documentBuilder = factory.newDocumentBuilder();
           DOCUMENT = documentBuilder.newDocument(); // assign empty XML Document
           Element MESSAGES = DOCUMENT.createElement("MESSAGES");
           Element MESSAGE = DOCUMENT.createElement("MESSAGE");
           Element CONTENT = DOCUMENT.createElement("CONTENT");
  
           CONTENT.setTextContent("Data content");
           DOCUMENT.appendChild(MESSAGES);
           MESSAGES.appendChild(MESSAGE);
           MESSAGE.appendChild(CONTENT);
  
           response.setHeader("Cache-Control", "no-cache");
           //set the content type
           response.setContentType("text/xml");
  
           XMLSerializer xmlserializer = new XMLSerializer(out, null);// Error
           xmlserializer.serialize(DOCUMENT);  
  </code></pre>
  
  <p>I am getting the XMLSerializer cannot be resolved to a type . This is Maven code and my pom.xml has </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.codehaus.castor&lt;/groupId&gt;
      &lt;artifactId&gt;castor&lt;/artifactId&gt;
      &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;xerces&lt;/groupId&gt;
      &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
      &lt;version&gt;2.8.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;xerces&lt;/groupId&gt;
      &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
      &lt;version&gt;2.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I am still getting the error as </p>
  
  <pre><code>XMLSerializer cannot be resolved to a type
  </code></pre>
  
  <p>Is there any dependency still missing ? </p>