Because the $X_i$ are ordered, these are integer compositions with restrictions. But by suitable conversion (bijection) one can usually count these using combinations (and binomial coefficients). For your particular examples,
- $X_i \in \{0,1\}$, these are the number of combinations of size $n$ from $k$ items or ${k \choose n}$.
- $X_i \ge 0$, this is the 'stars and bars' problem, where you're counting the number of configurations of $n$ stars and $k-1$ bars in sequence (that is $n$ items separated into $k$ ordered parts by the $k-1$ bars). E.g. for $n = 2$ and $k = 3$, the ways of doing it are: "##||" ,"#|#|","#||#","|##|","|#|#","||##". This is counted by ${n+k-1 \choose n}$ (the positions of $n$ stars in a string of length $n+k-1$ or equivalently ${n+k-1 \choose k-1}$ the position of the $k-1$ bars).
- $X_i \ge 1$, just subtract $k$ from $n$ to get the same problem (that is, if you -have- to have at least one item in each bin, just count the ways to do it as if you have 1 less item in each bin). This is ${n-1 \choose k-1}$.
- for more general restrictions on the number of items in each bin, you may need to do some inclusion-exclusion. For lower bounds $m_1$, just subtract off like in the previous problem. For upper bounds, count the number of ways when the lower bound is $m_2+1$ (again using the previous problem) and subtract from the solution when it is unbounded.
So these are strategies geared towards the specific problem given. You might see much more complex restrictions than you've given, and there you'll probably want to use a more general method like generating functions as mentioned in other answers.