I am using dom4j to overwrite a value in the XML. The XML looks like this:
The XPath that you are using is looking for a time attribute equal to 555555 on element1. However, your time attributes are on the name nodes.
You could go either the way Tomalak suggested, or change it to:
//element1[../@time='555555']
This is looking for an element1 node with a parent who has a time attribute equal to 555555.