public static function getFirstChildElement($element)
    {
        $children = $element->childNodes;
        for ($i = 0; $i < $children->length; $i++) {
            $child = $children->item($i);
            if ($child->nodeType === XML_ELEMENT_NODE) {
                return $child;
            }
        }

        return false;
    }
public static function getFirstChildElement($element)
    {
        $children = $element->childNodes;
        for ($i = 0; $i < $children->length; $i++) {
            $child = $children->item($i);
            if ($child->nodeType === XML_ELEMENT_NODE) {
                return $child;
            }
        }

        return false;
    }
public static function getFirstChildElement ( $ element ) { $ children = $ element -> childNodes ; for ( $ i = 0 ; $ i < $ children -> length ; $ i ++ ) { $ child = $ children -> item ( $ i ) ; if ( $ child -> nodeType === XML_ELEMENT_NODE ) { return $ child ; } } return false ; }
Get the first child DOM Node with nodeType attribute equals to XML_ELEMENT_NODE.
This is very useful to get a sub-node without having to exclude text nodes, cdata,
... manually.

@param DOMElement $element A DOMElement object
@return DOMElement|boolean A DOMElement If a child node with nodeType = XML_ELEMENT_NODE or false if nothing found.
Get the first child DOM Node with nodeType attribute equals to XML_ELEMENT_NODE . This is very useful to get a sub - node without having to exclude text nodes cdata ... manually .