Removed the old hamgen function.
Added XML for linearmatrix element function and fixed an error with the cross-quadratic terms.