deriveXmlWithOptions :: Options -> Name -> DecsQ
deriveXmlWithOptions opts name = do
  let ns = "Network.AuthorizeNet.TH.deriveXml: Name was '" ++ showName name ++ "':"
  info <- reify name
  decs <- case info of
    TyConI dec ->
      case dec of
        NewtypeD{} -> deriveXmlNewtype opts name
        DataD _ _ tvbs cons _ | isAllNullary cons && allNullaryToStringTag opts -> deriveXmlEnum opts name
        DataD _ _ tvbs [con] _ -> deriveXmlObject opts name
        DataD _ _ tvbs cons  _-> deriveXmlChoice opts name
        _ -> error $ ns ++ "Only newtypes or data constructors can be derived."
  xmlParsableDecs <- deriveXmlParsable opts name
  return $ decs ++ xmlParsableDecs
deriveXmlWithOptions :: Options -> Name -> DecsQ
deriveXmlWithOptions opts name = do
  let ns = "Network.AuthorizeNet.TH.deriveXml: Name was '" ++ showName name ++ "':"
  info <- reify name
  decs <- case info of
    TyConI dec ->
      case dec of
        NewtypeD{} -> deriveXmlNewtype opts name
        DataD _ _ tvbs cons _ | isAllNullary cons && allNullaryToStringTag opts -> deriveXmlEnum opts name
        DataD _ _ tvbs [con] _ -> deriveXmlObject opts name
        DataD _ _ tvbs cons  _-> deriveXmlChoice opts name
        _ -> error $ ns ++ "Only newtypes or data constructors can be derived."
  xmlParsableDecs <- deriveXmlParsable opts name
  return $ decs ++ xmlParsableDecs
deriveXmlWithOptions opts name = do
  let ns = "Network.AuthorizeNet.TH.deriveXml: Name was '" ++ showName name ++ "':"
  info <- reify name
  decs <- case info of
    TyConI dec ->
      case dec of
        NewtypeD{} -> deriveXmlNewtype opts name
        DataD _ _ tvbs cons _ | isAllNullary cons && allNullaryToStringTag opts -> deriveXmlEnum opts name
        DataD _ _ tvbs [con] _ -> deriveXmlObject opts name
        DataD _ _ tvbs cons  _-> deriveXmlChoice opts name
        _ -> error $ ns ++ "Only newtypes or data constructors can be derived."
  xmlParsableDecs <- deriveXmlParsable opts name
  return $ decs ++ xmlParsableDecs