xmojmr makes a good point that this isn't really a concrete code help question.
In any case -- in my opinion, formats like that ought not to be in the scope of the Cytoscape.js project. Cytoscape.js is a graph library for JS, and file parsing should be a separate library. Such a library would not even need to support the particular Cytoscape.js JSON "format", because it's very simple to map one array of objects (resultant from the parse) to the hierarchy expected by Cytoscape.js.
The XGMML format itself isn't very good in my opinion, and that's another strike against including it. Many people do have legacy data in that format though, so you may find a generic JS XML parsing lib useful. If you just need the graph data from the XGMML, then using a JS XML parsing lib should make it fairly straightforward to map to whatever JSON format you like.