public Document buildValidMovesList(Document document, Element root, ReversiBoard board) {
        Element validMovesElement = document.createElement("valid_moves");
        for (int i = 0; i < board.getValidMoves(board.getCurrentPlayerNum()).size(); i++) {
            Element position = document.createElement("move_" + i);
            Text text = document.createTextNode(String.valueOf(board.getValidMoves(board.getCurrentPlayerNum()).get(i)));
            position.appendChild(text);
            validMovesElement.appendChild(position);
        }
        root.appendChild(validMovesElement);
        return document;
    }