I am sorry for what the poor girl had to go through and hope that she will be fine.
Good she is Asian, coz when I was attacked nobody ever helped me.
All the "five" times that has happened actually people just joined in, because they thought I must have started a new opium war, killed a Chinese or despite my white face thought I was a Japanese soldier deployed in Nanjing, to deserve a beating like that.
So beating up a foreigner, doesn't need a reason thanks to powerful propaganda.
Actually my girlfriend at that time and witness of at least two of those attacks, told me later that they have a Blog in Beijing where you can meet up to mash up Laowai's.
I have no problem with justified violence helping in an emergency or selfdefence but here, I am sorry to say, it ALWAYS and severely goes beyond justification.
I have extensive martial art and military training, and I never was a coward but HERE the only defensive move for me is to run to keep this "beautiful" culture more harmonious and myself alive.
Hope the rapist will survive to see a proper judge, rot in prison and the girl will get over the shock. And mostly for the people here to grow up and learn to fix problems using solutions other than violence even when catching a criminal, disregarding nationality as said by other bloggers a laowai attempting to rape a girl is as bad as a Chinese or any other, trying to do so.