title: How do you "refactor" ant build.xml files?
body: <p>I'm working on a large C++ system built with ant+<a href="http://ant-contrib.sourceforge.net/cpptasks/index.html" rel="noreferrer">cpptasks</a>.  It works well enough, but the build.xml file is getting out of hand, due to standard operating procedure for adding a new library or executable target being to copy-and-paste another lib/exe's rules (which are already quite large).  If this was "proper code", it'd be screaming out for refactoring, but being an ant newbie (more used to make or VisualStudio solutions) I'm not sure what the options are.</p>
  
  <p>What are ant users' best-practices for stopping ant build files exploding ?</p>
  
  <p>One obvious option would be to produce the build.xml via XSLT, defining our own tags for commonly recurring patterns.  Does anyone do that, or are there better ways ?</p>