Axisymmetric magnetostatic equilibria have been widely applied to discribing stellar atmospheric structures of various scales.The so-called magnetic flux function may be introduced for such equilibria to represent the magnetic field,and it satisfies a nonlinear,elliptic equation with variable coefficients.Analytic solutions have been given only for certain spe-cialications of this equation so far,whereas in more complicated cases,especially nonlinear cases,no effective approach is found for analytic treatment.This paper uses the so-called method of infinitesimal transformations to derive similarity solutions of the nonlinear elliptic equation with variable coefficients,mentioned above,and presents some general results.The concrete forms of the solutions and their application to the solar atmosphere is relegated to the subsequent papers of this series.