code: public static Element[] getChildren( Element root, String name )
      {
          if( null == root )
          {
              return new Element[0];
          }
          NodeList list = root.getElementsByTagName( name );
          int n = list.getLength();
          ArrayList<Element> result = new ArrayList<Element>();
          for( int i = 0; i < n; i++ )
          {
              Node item = list.item( i );
              if( item instanceof Element )
              {
                  result.add( (Element) item );
              }
          }
          Element[] retval = new Element[result.size()];
          result.toArray( retval );
          return retval;
      }
docs: Return all children matching the supplied element name.
  
  @param root the parent DOM element
  @param name the name against which child element will be matched
  
  @return the array of child elements with a matching name