Merge relevant changes from 3.0 branch

Adds builder API.
Convert xml parsing from JAXB to StAX.