The test file at https://github.com/mozilla/pdf.js/blob/master/test/pdfs/annotation-choice-widget.pdf contains listboxes, which are not rendered correctly when printed right now. These kinds of fields are made by https://github.com/mozilla/pdf.js/blob/master/src/display/annotation_layer.js#L672-L678.

/cc @calixteman 
const xml = new SimpleXMLParser({ hasAttributes: true }).parseFromString(str);
  for (const { xfa } of newRefs) {
    if (!xfa) {
      continue;
    }
    const { path, value } = xfa;
    if (!path) {
      continue;
    }
    const node = xml.documentElement.searchNode(parseXFAPath(path), 0);
    if (node) {
      node.childNodes = [new SimpleDOMNode("#text", value)];
    } else {
      warn(`Node not found for path: ${path}`);
    }
  }
  const buffer = [];
  xml.documentElement.dump(buffer);
  return buffer.join("");
}
function updateXFA({