Most likely, the online tool you're using doesn't support namespace prefix in the XPath. I tried to remove prefixes from the XML, for example this element :
<ns:FinancialOrganization xmlns:ns="http://www.starstandard.org/STAR/5">
became this unprefixed element :
<FinancialOrganization xmlns:ns="http://www.starstandard.org/STAR/5">
Then this XPath returned 3
as expected :
count(/Lenders/FinancialOrganization/BusinessTypeCode)
In my expereience using several .NET libraries that support XPath, we need to manually declare prefix-to-namespace-URI mapping before we can use that prefix in our XPath query. It seems that the same applies in Java.