Using
XMLTask shoudl work as you found out. Note the xmlcatalog attribute which lets you specify a local DTD if one is not available.
Another option is to use Ant tasks to:
1) Read the file into a property
2) Use the replace task to change the text. (Regular expressions support line breaks.)
3) Echo the property back to a file
The later appraoch would only work if you have some control over the format of the XML.