Using Namespaces in XSLT and XPath

You can use namespaces in XSLT and XPath like

<xsl:value-of select="//a:account/b:accountType"

For this to work in Java the document builder must be namespace aware otherwise namespaces are stripped when parsing the document and your transformation will fail for obvious reasons.

DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();

At least in JDK 6 the default seems to be false.