public static Element firstChildElement(Element element){
  if (element == null)   return null;
  Node node=element.getFirstChild();
  if (node != null) {
    do {
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        Element childElement=(Element)node;
        return childElement;
      }
    }
 while ((node=node.getNextSibling()) != null);
  }
  return null;
}

public static Element firstChildElement ( Element element ) { if ( element == null ) return null ; Node node = element . getFirstChild ( ) ; if ( node != null ) { do { if ( node . getNodeType ( ) == Node . ELEMENT_NODE ) { Element childElement = ( Element ) node ; return childElement ; } } while ( ( node = node . getNextSibling ( ) ) != null ) ; } return null ; }
return the first child element returns the first element .
