Iterator elementsIter = elements.iterator();
while (elementsIter.hasNext())
{
String expression = (String)elementsIter.next();
try {
XPath xp = new AXIOMXPath(expression);
Iterator nsIter = namespaces.iterator();
while (nsIter.hasNext())
{
OMNamespace tmpNs = (OMNamespace)nsIter.next();
xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
}
List selectedNodes = xp.selectNodes(envelope);
Iterator nodesIter = selectedNodes.iterator();
while (nodesIter.hasNext())
{
OMElement e = (OMElement)nodesIter.next();