That is not HTML, it is XML format of saving the entire chart window along with all the tabs in it. (see link at the end) it contains parameter info and chart related settings which are not part of AFL code.
If you want to save AFL formula, then right-click > Edit Formula which will open the file in Formula Editor. This is where the coding and AFL related stuff can be done from.
Similarly, if you save the Analysis window from where you Scan/Explore/Backtest, it will Save as APX project. It also has an edit button in the toolbar to view the AFL code.
There are charts with .chart and analysis with .apx extension. AFL as .afl is purely the formula code which is used within these two features.