how to split a huge file by every 100 lines

into small files. i need to add a head.txt and tail.txt into small files at the begin and end, and give a name as q1.xml q2.xml q3.xml ....

thank you very much.

See -l option of the split command : Man Page for split (Linux Section 1) - The UNIX and Linux Forums
Then, after split is done, do something like (code not tested):

#!/bin/sh

i=0
#split default names split files as xaa, xab, xac, ..., hence the x* in the command below
for f in x*; do
 i=$((i+1))
 cat head.txt "$f" tail.txt > "q$i.xml"
done

exit 0
split -l 100 INPUTFILE
c=0
for f in x??; do
  ((c++))
  cat head.txt $f tail.txt > q$c.xml
  rm $f
done

===

Hmm... The same solution.