You're writing code in 2018 ... a lot of code editors and IDEs have linting built-in, smart autocomplete functionality, etc.
Given the fact that xhtml has mandatory rules, you just need a code editor/plug-in that has strict guidelines for code completion/error handling regarding xhtml ... use VScode editor (you'll definitely find a linting plug-in for html/xhtml linting).