XML Needles in Haystacks

Our time with the War Service Bureau letters has really focused on data creation rather than analysis. This is a dataset-in-preparation rather than something that lies immediately ready for analysis. But since my notes on Whitman focused on metadata, I thought I’d gesture at how to take advantage of XML-encoded text.

After you’ve looked at a few of the WSB letters, you start to get a sense of the routines of correspondence, the implicit rules of tone and form. Since this was a Rutgers operation for alumni, the typical letter is either formal or a little chummy. What do the exceptions look like? I found one by focusing on closing salutations (“Sincerely,”), etc. I’ll show R code for extracting them. The letters that have already been edited are available in XML from a Github repository. Having downloaded this repository, its contents can be read in with the same pattern as I indicated in the Whitman post.

library(tidyverse)
library(xml2)
lett <- tibble(filename=Sys.glob("wsb-data/letters/*.xml")) |>
    # read in XML files
    mutate(xml=map(filename, read_xml)) |>
    # remove namespace for convenience
    mutate(xml=map(xml, xml_ns_strip))

It is easiest to extract the contents of closing salutations with XPath selectors:

closings <- lett |>
    # extract name of person whose correspondence it is
    mutate(corresp=map(xml, xml_find_first, "//title")) |>
    # extract text contents of <title> tag
    mutate(corresp=map_chr(corresp, xml_text)) |>
    # locate closing <salute> elements
    mutate(closing=map(xml, xml_find_all, "//closer/salute")) |>
    # extract text contents
    mutate(closing=map(closing, xml_text)) |>
    select(corresp, closing) |>
    unnest(closing)

There aren’t that many letters here (121) so there’s nothing stopping us from just looking down the list after doing a little string-cleaning. Comments follow this long table, but scan down it yourself and let your eye spot patterns!

closings |>
    mutate(closing=str_replace_all(closing, "\\s", " ")) |>
    knitr::kable()
corresp closing
Ainsworth, William P. E. Wishing you best of luck in that which you decide to do. In the bonds,
Ainsworth, William P. E. Thanking you in advance for the trouble, I am
Ainsworth, William P. E. In the bonds
Ainsworth, William P. E. Regards to all. I.T.B.
Ainsworth, William P. E. Cordially yours,
Ainsworth, William P. E. With regards to the college I am sincerely yours
Ainsworth, William P. E. Very cordially yours,
Ainsworth, William P. E. In the bonds.
Ainsworth, William P. E. Hoping to hear from you soon. In the bonds
Ainsworth, William P. E. Yours in the bonds,
Ainsworth, William P. E. Write soon In the bonds Pete
Ainsworth, William P. E. In the bonds
Ainsworth, William P. E. Write soon, Love
Ainsworth, William P. E. In the bonds
Ainsworth, William P. E. In the bonds
Bracher, Elmer Gladstone Yours in the Bonds
Bracher, Elmer Gladstone I amYours in the Bonds,
Bracher, Elmer Gladstone Yours in the Bonds,
Bracher, Elmer Gladstone Yours in the Bonds
Bracher, Elmer Gladstone Yours in the Bonds,
Bracher, Elmer Gladstone As ever
Bracher, Elmer Gladstone In the Bonds
Bracher, Elmer Gladstone In the Bonds
Bracher, Elmer Gladstone As ever In the Bonds
Bracher, Elmer Gladstone In The Bonds
Bracher, Elmer Gladstone Always in the Bonds
Bracher, Elmer Gladstone In the Bonds
Bracher, Elmer Gladstone Cordially,
Bracher, Elmer Gladstone In the Bonds
Bracher, Elmer Gladstone In the Bonds
Bracher, Elmer Gladstone In the Bonds,
Bracher, Elmer Gladstone Yours in the Bonds,
Bracher, Elmer Gladstone In the Bonds
Conklin, Sherman Lindsley Sincerely,
Conklin, Sherman Lindsley Kindly accept, Madam, the assurance of my deep and religious respect.
Conklin, Sherman Lindsley (Signed)
Conklin, Sherman Lindsley Very sincerely yours,
Conklin, Sherman Lindsley Yours sincerely,
Conklin, Sherman Lindsley Very sincerely yours,
Conklin, Sherman Lindsley Yours very sincerely
Conklin, Sherman Lindsley Very sincerely yours,
Conklin, Sherman Lindsley Thanking you for your kindness, I am Yours sincerely
Conklin, Sherman Lindsley Yours sincerely,
Conklin, Sherman Lindsley Very sincerely yours,
Conklin, Sherman Lindsley Very sincerely yours,
Conklin, Sherman Lindsley I am yours sincerely Sherman’s mother
Conklin, Sherman Lindsley Sincerely yours,
Costa, Joseph Louis Till I get enough energy together to write you again,Yours,
Costa, Joseph Louis Yours,
Costa, Joseph Louis Very cordially yours,
Costa, Joseph Louis Hastily yours,
Cubberley, Chester Curtis Hoping to hear from you soon I am. Very sincerely yours
Cubberley, Chester Curtis Very sincerely yours,
Cubberley, Chester Curtis Sincerely,
Cubberley, Chester Curtis Very sincerely yours,
Cubberley, Chester Curtis Sincerely yours ,
Cubberley, Chester Curtis Thanking you for whatever service you may be able to render, I am Very sincerely yours,
Cubberley, Chester Curtis Very sincerely yours,
Cubberley, Chester Curtis Very sincerely yours,
Cubberley, Chester Curtis Very sincerely yours,
Cubberley, Chester Curtis Sincerely
Cubberley, Chester Curtis Most cordially yours,
Cubberley, Chester Curtis I will close hoping to hear from you soon.
Cubberley, Chester Curtis Very sincerely yours,
Grimme, August L. Yours truly,
Grimme, August L. Sincerely,
Grimme, August L. Sincerely
Grimme, August L. Very sincerely yours,
Grimme, August L. Yours very truly,
Grimme, August L. Very truly yours,
Grimme, August L. Yours very truly,
Grimme, August L. Yours truly,
Grimme, August L. Yours sincerely,
Groendyke, Jacob W. With best personal regards, I am very truly yours,
Groendyke, Jacob W. Sincerely yours,
Groendyke, Jacob W. Best personal regards,
Groendyke, Jacob W. Hastily yours,
Groendyke, Jacob W. With all best wishes—
Groendyke, Jacob W. Cordially yours,
Groendyke, Jacob W. Sincerely yours,
Groendyke, Jacob W. Respectfully,
Groendyke, Jacob W. Very sincerely yours,
Groendyke, Jacob W. With kindest regards. Cordially yours,
Groendyke, Jacob W. Sincerely yours,
Groendyke, Jacob W. Very sincerely yours,
Jackson, Morris Bacon Yours,
Jackson, Morris Bacon Good luck to you and best wishes,
Jackson, Morris Bacon Very sincerely yours,
Jackson, Morris Bacon Love,
Jackson, Morris Bacon Yours Truly,
Jackson, Morris Bacon Very sincerly yours,
Jackson, Morris Bacon Yours
Jackson, Morris Bacon Sincerly yours,
Jackson, Morris Bacon Yours truly,
Jackson, Morris Bacon Very sincerely yours,
Jackson, Morris Bacon Thank you - Mrs Jackson joins me in appreciation
Jackson, Morris Bacon Very sincerely yours,
Jackson, Morris Bacon Yours,
Jackson, Morris Bacon Sincerely yours,
Jackson, Morris Bacon Cordially
Johnson, John W. Sincerely,
Johnson, John W. I am Sincerely
Johnson, John W. Very cordially yours,
Pelton, Graham Very sincerely yours,
Pelton, Graham Yours for success
Pelton, Graham Yours,
Pelton, Graham Very truly yours,
Pelton, Graham Very truly yours,
Voorhees, John Brownlee Very truly yours,
Voorhees, John Brownlee Wishing you success in this most interesting field of work, I am Sincerely yours,
Voorhees, John Brownlee Cordially ever,
Voorhees, John Brownlee Yours ever
Voorhees, John Brownlee Very sincerely yours,
Voorhees, John Brownlee Very sincerely yours,
Voorhees, John Brownlee Thanking you, I am Very sincerely yours,
Voorhees, John Brownlee I am Yours very truly,
Voorhees, John Brownlee Very sincerely yours,
Voorhees, John Brownlee Very sincerely yours,
Voorhees, John Brownlee Very sincerely yours,
Voorhees, John Brownlee I am most sincerely yours
Voorhees, John Brownlee Very sincerely yours,

What immediately leapt out to me in all the “Yours”es and “In the Bonds” were the two occurrences of “Love,” one in a letter from William Ainsworth and one from Morris Jackson. A simple string-pattern match (using stringr::str_detect) finds them:

closings |>
    filter(str_detect(closing, "Love")) |>
    knitr::kable()
corresp closing
Ainsworth, William P. E. Write soon, Love
Jackson, Morris Bacon Love,

It’s possible to extract the corresponding letters automatically, or even generate links to the web versions, but there comes a time when automated solutions are much more work than a few clicks in the web browser. Now that we know what we’re looking for, we can go to the web display of the War Service Bureau edition. The letter from Ainsworth signed “Love” is to his father just after the Armistice, and recounts some battle experiences in the Argonne offensive. I learn from the reference link in the note on the edited letter page that this was the deadliest campaign in US history, though you’d hardly know it from the letter. This is the sort of thing your editing can do.

More moving still is the other letter in question, from Morris “Jill” Jackson to his parents in July 1918. It is well worth reading. As you will see if you read on in the correspondence file, it is the last in the file by Jackson himself before his death from the flu pandemic (contracted while temporarily back in the US) that October. The letter itself is notable in its detailed and even lyrical evocation of the French countryside and the US Army’s engineering works in it, as well as the glance at “psychopathic cases,” i.e. shell-shocked soldiers.

It is no coincidence to find in these more intimate family letters—which is why they are signed with “Love”—particularly detailed and personal episodes of war experience.