To study the ion transport in the edge of a diverted tokamak plasma, an X-point Guiding Center (XGC) code is developed, which is a discrete plasma particle simulation code of ions in a diverted edge with kinetic neutral particles. A self-consistent electric field is evaluated and conserving Monte-Carlo collisions are used. calculated simultaneously. Using the XGC code the property of a velocity space hole due to vanishingly small poloidal magnetic field in the vicinity of a divertor X-point is studied in a single null geometry. The velocity space hole occupies a significant portion of the main ion velocity space in the absence of an electric field, but a radial electric field shifts the velocity hole to a higher energy and suppresses the loss, especially on the midplane.On the outside midplane, it is found that there is virtually no v-space hole with a reasonable radial electric field. A forward ∇B drift case is compared with a backward ∇B drift case, only to find that there is little difference in the loss hole size in the velocity space. However, the forward ∇B plasma occupies a much larger loss volume in real space due to flux expansion near the X-point. The steep neoclassical pedestal formation in a quiescent tokamak is also investigated. It is shown that the width of the steepest neoclassical pedestals is similar to an experimentally observed H-mode edge pedestal width. It is also shown that a steep neoclassical pedestal can form from an L-mode profile at a quiescent diverted edge by with the neutral ionization. The suppression of the steep pedestal and the strong radial E-field by a simply modeled turbulence is observed. The effect of fueling location on the toroidal flow is investigated. The simulation result is that the neutral fueling from the high field side location gives more toroidal rotation than that from the low field side, which agrees with the experimental observation that the high field side fueling allowed an easier H-mode access. For a more...