This paper gives a unified mathematical theory for numerical treatment of two--point boundary value problems of the form $-(p(x)u')'+f(x,u,u')=0,\ a\le x \le b,\ \alpha_0 u(a)-\alpha_1 u'(a)=\alpha,\ \beta_0 u(b)+\beta_1 u'(b)=\beta,\ \alpha_0,\alpha_1,\beta_0,\beta_1 \ge 0,\ \alpha_0+\alpha_1>0,\ \beta_0+\beta_1>0,\ \alpha_0 +\beta_0 >0$. Firstly, a unique existence of solution is shown with the use of the Schauder fixed point theorem, which improves Keller's result \cite{Keller}. Next, a new discrete boundary value problem with arbitrary nodes is proposed. The unique existence of solution for the problem is also proved by using the Brouwer theorem, which extends some results in Keller \cite{Keller} and Ortega--Rheinboldt \cite{Ortega}. Furthermore, it is shown that, under some assumptions on $p$ and $f$, the solution for the discrete problem has the second order accuracy $O(h^2)$, where $h$ denotes the maximum mesh size. Finally, observations are given.