You can do something like that in pure html using an <object> tag:
<div><object data="https://stackoverflow.com/questions/6348207/file.txt"></object></div>
This method has some limitations though, like, it won’t fit size of the block to the content – you have to specify width and height manually. And styles won’t be applied to the text.