drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
public static void declareNS(Element element, String prefix, String namespaceUrl) {
        Assert.isNotNull(element);
        Assert.isTrue(namespaceUrl != null || prefix == null && namespaceUrl == null);
        String name = XML_PREFIX + (prefix == null ? "" : ":" + prefix); //$NON-NLS-1$ //$NON-NLS-2$
        String value = namespaceUrl == null ? "" : namespaceUrl; //$NON-NLS-1$
        element.setAttribute(name, value);
    }
public static void declareNS(Element element, String prefix, String namespaceUrl) {
        Assert.isNotNull(element);
        Assert.isTrue(namespaceUrl != null || prefix == null && namespaceUrl == null);
        String name = XML_PREFIX + (prefix == null ? "" : ":" + prefix); //$NON-NLS-1$ //$NON-NLS-2$
        String value = namespaceUrl == null ? "" : namespaceUrl; //$NON-NLS-1$
        element.setAttribute(name, value);
    }
Adds a namespace declaration to the given element. If only the prefix
is <code>null</code>, a default namespace is declared. If the prefix
and the namespaceUrl are <code>null</code> the default namespace is
removed. The element must not be <code>null</code>. If the
namespaceUrl is <code>null</code>, the <code>prefix</code> must also
be <code>null</code>.

@param element      the element to receive the namespace attribute
@param prefix       the prefix to be used (without a colon); for
example, "D", or <code>null</code>
@param namespaceUrl the URL of the namespace; for example, "DAV:", or
<code>null</code>