if (nr != null) {
String prefix = nr.resolveNamespaceURI(name.getNamespaceURI());
if ((prefix != null) && !prefix.equals("")) {
qualifiedName = prefix + ":" + qualifiedName;
} else if (name.getNamespaceURI() != null && !name.getNamespaceURI().equals("")) {
String generatedPrefix = nr.generatePrefix();
qualifiedName = generatedPrefix + ":" + qualifiedName;
nr.put(generatedPrefix, name.getNamespaceURI());
extraNamespaces.add(generatedPrefix);
marshalRecord.attribute(XMLConstants.XMLNS_URL, generatedPrefix, XMLConstants.XMLNS + ":" + generatedPrefix, name.getNamespaceURI());
}