I'm confused. Are you asking about the org.w3c.dom.Document class? Because I don't see an isDeclaredNamespace() method in the documentation. There is an isDefaultNamespace() method, but it takes a String as a parameter and tells you whether that String is the URI of the default namespace. You didn't mention anything about passing a String to the method, and it does matter what String you pass it.