domSerializer.start(domSerializerPipelineContext);
return domSerializer.getDocument(domSerializerPipelineContext);
}
private static void addNeededNamespaceDeclarations(Element originalElement, Element copyElement, Set<String> alreadyDeclaredPrefixes) {
Set<String> newAlreadyDeclaredPrefixes = new HashSet<String>(alreadyDeclaredPrefixes);
<BUG>for (Iterator i = copyElement.declaredNamespaces().iterator(); i.hasNext();) {
Namespace namespace = (Namespace) i.next();
</BUG>
newAlreadyDeclaredPrefixes.add(namespace.getPrefix());
}

domSerializer.start(domSerializerPipelineContext);
return domSerializer.getDocument(domSerializerPipelineContext);
}
private static void addNeededNamespaceDeclarations(Element originalElement, Element copyElement, Set<String> alreadyDeclaredPrefixes) {
Set<String> newAlreadyDeclaredPrefixes = new HashSet<String>(alreadyDeclaredPrefixes);
for (Object o: copyElement.declaredNamespaces()) {
Namespace namespace = (Namespace) o;
newAlreadyDeclaredPrefixes.add(namespace.getPrefix());
}
