*
*/
private Element createResultsElement(ResultSet resultSet, Document doc) {
Element results = doc.createElement("results");
while (resultSet.hasNext()) {
SolutionMapping solutionMap = resultSet.next();
Set<Variable> keys = solutionMap.keySet();
Element result = doc.createElement("result");
results.appendChild(result);
for (Variable key : keys) {
Element bindingElement = doc.createElement("binding");
bindingElement.setAttribute("name", key.getName());
bindingElement.appendChild(createValueElement(
(Resource) solutionMap.get(key), doc));
result.appendChild(bindingElement);
}
}
return results;
}