Too much effort to write the program for you... but you will want to either investigate XPaths using namespaces:
XPathFactory.compile("//UML:UseCase/@name", Filters.attribute(), null,
Namespace.getNamespace("UML", "href://org.omg/UML/1.3"));
or navigating directly with Namespaces:
Parent.getChildren(name, Namespace).
Your issue is that you need to access all the UML-prefixed content with the namespace Namespace.getNamespace("UML", "href://org.omg/UML/1.3");
Rolf