Enumeration tmpIter = tmp.elements(); while ( tmpIter.hasMoreElements() )
Iterator tmpIter = tmp.iterator(); while ( tmpIter.hasNext() )
  private static void encodeArg( Document doc, Node node, Object arg )  {    if ( arg instanceof String )    {      String tmp = (String) arg;      // poor man's xml escaping...      tmp.replaceAll( ">", "&gt;" );      tmp.replaceAll( "<", "&lt;" );      tmp.replaceAll( "&", "&amp;" );      Element string = doc.createElement( "string" );      string.appendChild( doc.createTextNode( tmp ) );      node.appendChild( string );    }    else if ( arg instanceof Integer )    {      Integer tmp = (Integer) arg;      Element integer = doc.createElement( "int" );      integer.appendChild( doc.createTextNode( tmp.toString() ) );      node.appendChild( integer );    }    else if ( arg instanceof byte[] )    {      Element base64 = doc.createElement( "base64");      base64.appendChild( doc.createTextNode( Base64.encodeToString( (byte[]) arg, false)));      node.appendChild( base64 );    }    else if ( arg instanceof Vector )    {      Vector tmp = (Vector) arg;      Element array = doc.createElement( "array" );      Element data = doc.createElement( "data" );      array.appendChild( data );      Enumeration tmpIter = tmp.elements();      while ( tmpIter.hasMoreElements() )      {        Object element = tmpIter.nextElement();        Element value = doc.createElement( "value" );        encodeArg( doc, value, element );        data.appendChild( value );      }            node.appendChild( array );    }    else    {      System.out.println( arg.toString() );      System.out.println( "Unknown type encountered!" );    }  }