typeNodeName = typeNode.getNodeName();
  private static Object decodeArg( Node param ) throws Exception  {    if ( !param.getNodeName().contentEquals( "value") || param.getChildNodes().getLength() != 1 )    {      throw new Exception( "Invalid XML-RPC");    }        Node typeNode = param.getFirstChild();    String typeNodeName = typeNode.getNodeName();    if ( typeNodeName.contentEquals("string") )    {      if ( typeNode.getChildNodes().getLength() != 1 )      {        throw new Exception( "Invalid XML-RPC");      }            typeNode = typeNode.getFirstChild();    }        if ( typeNodeName.contentEquals("#text") )    {      // poor man's xml escaping...      String tmp = typeNode.getNodeValue();      tmp.replaceAll( ">", "&gt;" );      tmp.replaceAll( "<", "&lt;" );      tmp.replaceAll( "&", "&amp;" );            return tmp;    }    else if ( typeNodeName.contentEquals("int") || typeNodeName.contentEquals("int") )    {      if ( typeNode.getChildNodes().getLength() != 1 )      {        throw new Exception( "Invalid XML-RPC");      }            Node intNode = typeNode.getFirstChild();      return new Integer( intNode.getNodeValue() );    }    else if ( typeNodeName.contentEquals("array") )    {      Node dataNode = typeNode.getFirstChild();       if ( typeNode.getChildNodes().getLength() != 1 || !dataNode.getNodeName().contentEquals( "data" ) )      {        throw new Exception( "Invalid XML-RPC");      }            Vector objects = new Vector();      NodeList arrayNodeList = dataNode.getChildNodes();      for ( int arrayIndex = 0; arrayIndex < arrayNodeList.getLength(); arrayIndex++ )      {        objects.add( decodeArg( arrayNodeList.item( arrayIndex ) ) );      }            return objects;    }    else if ( typeNodeName.contentEquals("base64") )    {      if ( typeNode.getChildNodes().getLength() != 1 )      {        throw new Exception( "Invalid XML-RPC");      }            Node base64Node = typeNode.getFirstChild();      return Base64.decode( base64Node.getNodeValue() );    }    else     {      throw new Exception( "Unsupported XML-RPC type: " + typeNodeName );    }  }