private static boolean isStartElement(String line){
  int first=line.lastIndexOf("<");
  int last=line.lastIndexOf(">");
  if (last < first) {
    return true;
  }
 else {
    int firstEnd=line.lastIndexOf("</");
    int lastEnd=line.lastIndexOf("/>");
    if ((firstEnd != first) && ((lastEnd + 1) != last)) {
      return true;
    }
  }
  return false;
}

private static boolean isStartElement ( String line ) { int first = line . lastIndexOf ( "<" ) ; int last = line . lastIndexOf ( ">" ) ; if ( last < first ) { return true ; } else { int firstEnd = line . lastIndexOf ( "</" ) ; int lastEnd = line . lastIndexOf ( "/>" ) ; if ( ( firstEnd != first ) && ( ( lastEnd + 1 ) != last ) ) { return true ; } } return false ; }
tries to find out if the line finishes with an element start
