If you load the XML document into a DOM, then you can use XPath to search it. By default
Java supports XPath 1.0, which has a "starts-with"
string function so you can find elements whose Name attribute value starts with "a", for example. XPath 1.0 doesn't support regular expressions, but XPath 2.0 does. It looks to me like you might be able to use XPath 2.0 on your DOM if you could track down a suitable XPath 2.0 provider (XPathFactory allows you to load non-default providers) but I've never done that and never even seen anything which claims to do it.
You might find it easier just to traverse the elements in your DOM and compare the Name attributes using Java code for the regular expressions. You could use XPath to find all of the Name attributes and then apply the regular expressions to them in Java is what I mean.