The following creates a duplicate notebook before temporarily exporting the text. It removes all output cells.
CleanNotebook[nb_: SelectedNotebook[],
styles_: {"Output",
"Print"}] := (NotebookFind[nb, #, All, CellStyle];
NotebookDelete[nb];) & /@ styles;
nbExport[n_, new_: ""] :=
Module[{loc, nb},
loc = FileNameJoin[{$TemporaryDirectory, "output.txt"}];
nb = CreateDocument[n, Visible -> False];
CleanNotebook[nb];
FrontEndExecute[FrontEndToken[nb, "Save", {loc, "Text"}]];
NotebookClose[nb];
(*ret=StringReplace["\n"<>Import[loc,"Text"],"\nIn["~~
ShortestMatch[___]~~"]:= "\[Rule]""];*)NotebookClose[nb];
If[new != "", CopyFile[loc, new];];
Return[Import[loc]]];
Convert current nb to text.
nbExport[NotebookGet[InputNotebook[]][[1]]];
Or convert BoxData to text.
nbExport[{Cell[
BoxData[RowBox[{"1", "\[IndentingNewLine]", RowBox[{"+", "1"}]}]],
"Input"]}]