Note that there might not always be an XML namespace on the math tag. Not sure if that will be a problem or not. HTML5 special cases the MATH and SVG tags as being in the correct namespaces.