Both answers that tried to explain are incorrect in explaining the grammaticality of the phrase. The verb "to be" is an intransitive verb, meaning it cannot take an object. English is a West Germanic language, thus some odd expressions like this have origins in our former case system. For those of you who have studied German, you will recall that it is correct to say "es ist mir kalt", or "mir ist kalt" rather than "ich bin kalt" (for the uninitiated respectively, "it is me cold" or "me is cold", rather than "I am cold"). The equivalent of the phrase "woe is me" in German is "Weh mir" (Woe (unto) me). This is because the phrase utilizes the dative case, a case English had before the Norman influence on the language after 1066. Since the conquest, the English language's accusative and dative cases merged into one oblique case, which creates the ambiguity of the (Early) Modern English usage of the phrase. Thus, the grammaticality of the phrase has its origins in an archaic system English once used, and was certainly not very foreign to Early Modern English speakers such as Shakespeare.
The use of the phrase is found in Wycliffe's translation of the Bible (1382) and William Shakespeare's Hamlet via quotes from the Bible (1602).
Wycliffe (Job 10:15) And if Y was wickid, wo is to me; and if Y was iust, Y fillid with turment and wretchidnesse `schal not reise the heed.
The term 'woe-is-me'ing would best be defined as declaring that one is in a state of distress or grief.
I took the time to explain the grammaticality of an archaic phrase on the Internet. Woe is me! I am 'woe-is-me'ing...