Interesting problem... Is this a template system you designed?
There's probably a lot of ways to go about doing this, but its a matter of finding one that will fit your needs and code.
When I do templates, I ONLY use include files for what I consider my "library files" or files that provide function/class functionality to my scripts (example: database and template routines are parked in an include file).
I then have a collection of HTML files with tokens or you could say variables my template system will recognize.
The trick is when you're handling your templates, you really need to have all your strings assembled and put together before you can swap out your tokens (like {CONTENT}).
As you're noticing, include() isn't cutting it for you. I have no idea what's in these files. But one approach is to use the file open/read functions available to PHP. Read the contents of the file into a string. Modify the string as needed afterwards. THEN parse your template and swap out {CONTENT}.
Using templates is a pretty good way of seperating the HTML from your PHP code...