drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java
public static Element getChildElement(Element parent, boolean firstToLast) {
        Assert.isNotNull(parent);
        Node child = null;
        if (firstToLast)
            child = parent.getFirstChild();
        else
            child = parent.getLastChild();
        while (child != null && !isElement(child)) {
            if (firstToLast)
                child = child.getNextSibling();
            else
                child = child.getPreviousSibling();
        }
        return (Element) child;
    }
public static Element getChildElement(Element parent, boolean firstToLast) {
        Assert.isNotNull(parent);
        Node child = null;
        if (firstToLast)
            child = parent.getFirstChild();
        else
            child = parent.getLastChild();
        while (child != null && !isElement(child)) {
            if (firstToLast)
                child = child.getNextSibling();
            else
                child = child.getPreviousSibling();
        }
        return (Element) child;
    }
public static Element getChildElement ( Element parent , boolean firstToLast ) { Assert . isNotNull ( parent ) ; Node child = null ; if ( firstToLast ) child = parent . getFirstChild ( ) ; else child = parent . getLastChild ( ) ; while ( child != null && ! isElement ( child ) ) { if ( firstToLast ) child = child . getNextSibling ( ) ; else child = child . getPreviousSibling ( ) ; } return ( Element ) child ; }
Returns the first child element of the given parent element, or
<code>null</code> if no such child exists. If firstToLast is true,
the search for the child starts at the parent's first child,
otherwise, the search starts at the parent's last child. The parent
must not be <code>null</code>.

@param parent      the parent of the child element to search for
@param firstToLast a boolean specifying the direction to search for
the child element among the parent's children
@return            the child element, or <code>null</code> if no such
child exists
Returns the first child element of the given parent element or <code > null< / code > if no such child exists . If firstToLast is true the search for the child starts at the parent s first child otherwise the search starts at the parent s last child . The parent must not be <code > null< / code > .