org.w3c.dom.Document doc =
db.parse(new java.io.FileInputStream(signatureFile));
XPathFactory xpf = XPathFactory.newInstance();
XPath xpath = xpf.newXPath();
xpath.setNamespaceContext(new DSNamespaceContext());
String expression = "//ds:Signature[1]";
NodeList signatureElems =
(NodeList) xpath.evaluate(expression, doc, XPathConstants.NODESET);