There is plenty of source code available for servlet containers. You can download the source for the reference servlet container "Tomcat" from
http://jakarta.apache.org/ or the popular and efficient Resin from
http://www.caucho.com/ . Either of these will include an implementation of getParameter(
String).
The format of HTTP POST requests was decided long before XML was even proposed. It may be a bit clumsy, but it works, and for flat name/value pairs it's quite an efficient transfer format.
If you are extracting the parameter values in a servlet, why are you attempting to parse out your own parameters rather than just using the built in parameter parsing? It's trivial to make a loop which reads all the provided parameters and builds them into some other format.