Lightweight xml parser and writer