This is a question on Quora that I keep referring to when building sites with XHP. XHP is really flexible when you get stuck in. If you haven't already, <a href="https://coderwall.com/p/3leegq" target="_blank">get stuck in!</a>
http://www.quora.com/XHP/How-does-Facebook-organize-its-XHP-code