Allow embedded resources in XML.

Hi Ben, here I am again :smile: 

When testing, I found out that embedding resources in XML did not work, so I've fixed it.

Could you please take a look and merge this?

Thanks!