Found the error! The property was re-defined like this:
public string Document
{
get
{
return HttpUtility.HtmlEncode(txtDocument.Text);
}
set
{
txtDocument.Text = HttpUtility.HtmlEncode(value);
}
}
So the HtmlEncoding was the thing that was messing up with my string.
Thanks anyway!