Cycles standalone Render Layers and Composite nodes The Blender version of Cycles can use the result of specific render passes as the final composite image.

For example, normals can be rendered instead of the regular image, as seen in the image below.



I would like to do the same in Cycles standalone.


Saving the scene shown in the image to a .blender file and converting it to Cycles standalone API didn't export the Composite node
There aren't Render Layers or Composite nodes in the Cycles XML nodes source code


What is the best way of capturing the result of render passes such as Normal, AO, Shadow, Emission, etc. in Cycles standalone?


Can it be done through the XML API? From what I've seen so far, it doesn't seem possible.
Can it be done by modifying the source code? If yes, can anyone point me in the right direction?
Cycles is a renderer. It provides the data that a compositor can use to combine the data to a final image. Blender's compositor is written inside blender and cannot be run outside Blender as it is tight related to other parts of Blender's pipeline.

So basically the answer to your question is no, you cannot do it via the XML API of Cycles as it does not know anything about compositing; except producing the combined pass, which cannot be influenced.

You can always modify Blender as it is open source, but there are other channels that are better to ask these development questions, like IRC or https://devtalk.blender.org/