I have found only Python and OGR solutions.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
I'd use the OpenLayers Format readers and writers.
GeoJSON writer here http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html
May be overkill to just convert from GML to GeoJSON, but OpenLayers API are widely used and tested, and also easy to extend.
Also, you could create a small OpenLayers build with just those classes and their dependencies.