(XPathFilter2ParameterSpec) getParameterSpec();
String prefix = DOMUtils.getNSPrefix(context, Transform.XPATH2);
String qname = (prefix == null) ? "xmlns" : "xmlns:" + prefix;
List list = xp.getXPathList();
for (int i = 0, size = list.size(); i < size; i++) {
XPathType xpathType = (XPathType) list.get(i);
Element elem = DOMUtils.createElement
(ownerDoc, "XPath", Transform.XPATH2, prefix);
elem.appendChild
(ownerDoc.createTextNode(xpathType.getExpression()));
DOMUtils.setAttribute
(elem, "Filter", xpathType.getFilter().toString());
elem.setAttributeNS("http://www.w3.org/2000/xmlns/", qname,
Transform.XPATH2);
// add namespace attributes, if necessary
Iterator it = xpathType.getNamespaceMap().entrySet().iterator();
while (it.hasNext()) {
Map.Entry entry = (Map.Entry) it.next();
elem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:"
+ (String) entry.getKey(), (String) entry.getValue());
}