Ignoring the "easily" part the question title, here is a giant hack that is fairly decent, provided you deal with small XML columns.
This is a proof of concept without much thought to optimization. Written against 2008 R2.
--Drop any previously existing objects, so we can run this multiple times.
IF EXISTS (SELECT * FROM sysobjects WHERE Name = 'TableToUpdate')
DROP TABLE TableToUpdate
IF EXISTS (SELECT * FROM sysobjects WHERE Name = 'vw_TableToUpdate')
DROP VIEW vw_TableToUpdate
--Create our table with the XML column.
CREATE TABLE TableToUpdate(
Id INT NOT NULL CONSTRAINT Pk_TableToUpdate PRIMARY KEY CLUSTERED IDENTITY(1,1),
XmlData XML NULL
)
GO
--Create our view updatable view.
CREATE VIEW dbo.vw_TableToUpdate
AS
SELECT
Id,
CONVERT(VARCHAR(MAX), XmlData) AS XmlText,
XmlData
FROM dbo.TableToUpdate
GO
--Create our trigger which takes the data keyed into a VARCHAR column and shims it into an XML format.
CREATE TRIGGER TR_TableToView_Update
ON dbo.vw_TableToUpdate
INSTEAD OF UPDATE
AS
SET NOCOUNT ON
DECLARE
@Id INT,
@XmlText VARCHAR(MAX)
DECLARE c CURSOR LOCAL STATIC FOR
SELECT Id, XmlText FROM inserted
OPEN c
FETCH NEXT FROM c INTO @Id, @XmlText
WHILE @@FETCH_STATUS = 0
BEGIN
/*
Slight limitation here. We can't really do any error handling here because errors aren't really "allowed" in triggers.
Ideally I would have liked to do a TRY/CATCH but meh.
*/
UPDATE TableToUpdate
SET
XmlData = CONVERT(XML, @XmlText)
WHERE
Id = @Id
FETCH NEXT FROM c INTO @Id, @XmlText
END
CLOSE c
DEALLOCATE c
GO
--Quick test before we go to SSMS
INSERT INTO TableToUpdate(XmlData) SELECT '<Node1/>'
UPDATE vw_TableToUpdate SET XmlText = '<Node1a/>'
SELECT * FROM TableToUpdate
If you open vw_TableToUpdate in SSMS, you are allowed to change the "XML", which will then update the "real" XML value.
Again, ugly hack, but it works for what I need it to do.