dump xyz file with energy and forces

no. dumps can only contain per-atom data. there are (currently) no provisions to have global data included.

this is all documented in the LAMMPS manual. please do yourself a favor and have a (careful!) read of the relevant sections.

axel.