I played with including the formula from a separate file, Client Side Include.
=== Summary ===
I think the "include" is not going to work well enough and hence not worth to invest in it.
So, bottom line, I give up for now on "include", and so I will make the changes in Similarity.java.
=== Details ===
Iframe can work for both the javadocs and the xdocs - I think that Embed also would work though I did not try it.
Both Iframe and Embed have a problem of appearance: you have to decide on the size of the frame showm, in pixels. If you set too large an area, blank space will remain. If you set a too small area, scroll bars would show up. If the user changes the text side, the required area size is changing, but not the allocated area, so scrollbars or blank space are showing up and disapearing. Very ugly.
Iframe also has an issue with inner links navigation: once you navigate to an anchor text in the iframe part (this works), the back action from some reason does not work (both Firefox and IE).
Bottom line, I give up for now on "include", and so I will make the changes in Similarity.java.