     first-child-tag params>array ;
 
 : parse-method ( xml -- string array )
-    children-tags dup first children>string
-    swap second params>array ;
+    children-tags first2
+    [ children>string ] [ params>array ] bi* ;
 
 : parse-fault ( xml -- fault-code fault-string )
     first-child-tag first-child-tag first-child-tag


M: server-error error.
    "Error in XML supplied to server" print
    "Description: " write dup server-error-message print
    "Tag: " write server-error-tag xml>string print ;

PROCESS: xml>item ( tag -- object )



GENERIC: send-rpc ( rpc -- xml )
M: rpc-method send-rpc
    [ name>> ] [ params>> ] bi method-call ;
M: rpc-response send-rpc
    params>> return-params ;
M: rpc-fault send-rpc
    [ code>> ] [ string>> ] bi return-fault ;

! * Recieving RPC requests
! this needs to have much better error checking
