How can I tell if a PDF has forms in AcroForm or XFA format?

Q: How can I tell if the document has names in AcroForm or XFA format?
I'll be dealing with a mixture and I can't control it.

I found an article, "Does PDFNet SDK support XFA/LiveCycle PDF
forms?," in this forum and would like to flag all XFA documents.
------
A: A PDF document may contain only AcroForms, only XFA Forms, or
both. For purposes of long term PDF archiving and compatibility it is
not recommended to use XFA/LiveCycle Forms (as described in the
article).

To check if a PDF document contains XFA (LiveCycle Designer) Forms you
could use the following snippet:

Obj acro_form = pdfdoc.GetAcroForm();
if (acro_form != null)
{
  // This PDF document contains forms...
  if (acro_form.FindObj("XFA") != null) {
      // This PDF document contains XFA forms...
  }
}