protected Element elementBeforeImpl(String name, String namespaceURI) {
        Node parentNode = this.xmlNode.getParentNode();
        assertElementContainsNoOrWhitespaceOnlyTextNodes(parentNode);

        Element newElement = (namespaceURI == null
            ? getDocument().createElement(name)
            : getDocument().createElementNS(namespaceURI, name));

        // Insert new element before the current element
        parentNode.insertBefore(newElement, this.xmlNode);
        // Return a new builder node pointing at the new element
        return newElement;
    }
protected Element elementBeforeImpl ( String name , String namespaceURI ) { Node parentNode = this . xmlNode . getParentNode ( ) ; assertElementContainsNoOrWhitespaceOnlyTextNodes ( parentNode ) ; Element newElement = ( namespaceURI == null ? getDocument ( ) . createElement ( name ) : getDocument ( ) . createElementNS ( namespaceURI , name ) ) ; parentNode . insertBefore ( newElement , this . xmlNode ) ; return newElement ; }
Add a named and namespaced XML element to the document as a sibling element
that precedes the position of this builder node.

@param name
the name of the XML element.
@param namespaceURI
a namespace URI

@throws IllegalStateException
if you attempt to add a sibling element to a node where there are already
one or more siblings that are text nodes.