Add global option to XHTML parse regex to handle complex XHTML

Cleaned up PR.