/**
   * This method typecasts the given {@link XmlObject} to the required generator type and returns
   * back the document of that generator type.
   *
   * @param xmlObject which needs to be converted to the document type of the required generator
   * @return {@link XmlObject} document of the required generator type
   * @see org.kuali.kra.s2s.generator.S2SFormGenerator#getFormObject(XmlObject)
   */
  public XmlObject getFormObject(XmlObject xmlObject) {

    GEPA427AttachmentsDocument gepa427Document = GEPA427AttachmentsDocument.Factory.newInstance();
    GEPA427Attachments gepAttachments = (GEPA427Attachments) xmlObject;
    gepa427Document.setGEPA427Attachments(gepAttachments);
    return gepa427Document;
  }
  /**
   * This method returns GEPA427AttachmentsDocument object based on proposal development document
   * which contains the GEPA427AttachmentsDocument informations about GEPA type attachment for a
   * particular proposal
   *
   * @return gepa427Document(GEPA427AttachmentsDocument){@link XmlObject} of type
   *     GEPA427AttachmentsDocument.
   */
  private GEPA427AttachmentsDocument getGEPA427Attachments() {

    GEPA427AttachmentsDocument gepa427Document = GEPA427AttachmentsDocument.Factory.newInstance();
    GEPA427Attachments gepAttachments = GEPA427Attachments.Factory.newInstance();
    gepAttachments.setFormVersion(S2SConstants.FORMVERSION_1_1);
    AttachedFileDataType attachedFileDataType = null;
    for (Narrative narrative : pdDoc.getDevelopmentProposal().getNarratives()) {
      if (narrative.getNarrativeTypeCode() != null
          && Integer.parseInt(narrative.getNarrativeTypeCode()) == NARRATIVE_TYPE_ED_GEPA427) {
        attachedFileDataType = getAttachedFileType(narrative);
        if (attachedFileDataType != null) {
          gepAttachments.setAttachments(attachedFileDataType);
          break;
        }
      }
    }
    gepa427Document.setGEPA427Attachments(gepAttachments);
    return gepa427Document;
  }