title: How to validate an xml file in ant?
body: <p>this is my xml file
     <code>&lt;contacts&gt;</code>
  <code>&lt;contact&gt;</code>
  <code>&lt;firstname&gt;Edwin&lt;/firstname&gt;</code>
  <code>&lt;lastname&gt;Dankert&lt;/lastname&gt;</code>
  <code>&lt;/contact&gt;</code>
  <code>&lt;/contacts&gt;</code></p>
  
  <p>i want to validate it in ant,my target is</p>
  
  <pre><code>&lt;target name="WellFormed"&gt;
  &lt;xmlvalidate file="contacts.xml"/&gt;
  &lt;echo&gt;WELL FORMED&lt;/echo&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>C:\work\build\XML_VALIDATION>ant
  Buildfile: C:\work\build\XML_VALIDATION\build.xml</p>
  
  <p>&lt;==========================ANT OUTPUT=============================></p>
  
  <pre><code>WellFormed:
  [xmlvalidate] contacts.xml:1:11: Document root element "contacts", must match DOCTYPE root "null".
  
  [xmlvalidate] contacts.xml:1:11: Document is invalid: no grammar found.
  
  BUILD FAILED
  C:\work\build\XML_VALIDATION\build.xml:4: C:\work\build\XML_VALIDATION\contacts.xml is not a valid XML document.
  </code></pre>
  
  <p>i am not checking it against any xsd,can anyone help me in finding what changes i need to insert into the xml.</p>