// rewrite DOM as a string to find differences, since text outside the root element is not tracked
StringWriter w = new StringWriter();
Format format = Format.getRawFormat();
format.setLineSeparator(eol);
XMLOutputter out = new XMLOutputter(format);
out.output(document.getRootElement(), w);
int index = content.indexOf(w.toString());
if (index >= 0)
{
intro = content.substring(0, index);