factorized CRestAPI::compileXML()